title: How can I reorder columns in a DataGridView?
body: <p>so I fill my DGV with some data and set some columns invisible:</p>
  
  <pre><code>        var part = inventory.espiromex_product.Where(p =&gt; p.descriptionsmall == cmbMainP.Text).First().partnumberp;
          dtgAssy.DataSource = inventory.espiromex_productsub.Where(p =&gt; p.partnumberp == part);
          dtgAssy.Columns["idproductsub"].Visible = false;
          dtgAssy.Columns["partnumberp"].Visible = false;
          dtgAssy.Columns["partnumbersubp"].Visible = true;
          dtgAssy.Columns["quantity"].Visible = true;
          dtgAssy.Columns["comments"].Visible = true;
          dtgAssy.Columns["assemblyno"].Visible = false;
          dtgAssy.Columns["assemblynodesc"].Visible = false;
          dtgAssy.Columns["uomid"].Visible = true;
          dtgAssy.Columns["subassemblylevelnumber"].Visible = false;
          dtgAssy.Columns["scrappercent"].Visible = true;
  </code></pre>
  
  <p>this is just fine but columns are sorted Alphabetically, How can I reorder columns programmatically?</p>
  
  <p>note that inventory is an Entitie and I am using Linq to Entities.</p>