title: C# datagrid each column width based on percent of total? asp.net
body: <p>I have a DataGrid that's being populated with the code below, the code below makes the overall grid the size I want but it does set the column width.  What I want to do is be able to say hey there is 'x' columns in a datatable and my tablewidth is 'xInt' divide xint by 'x' columns (which i've done, i'm just not sure have to set the column width...)</p>
  
  <p>Thanks!</p>
  
  <pre><code>    int tableWidth = 650;
      int columnCount = dtTable.Columns.Count;
      int columnWidth = Math.Abs(tableWidth / columnCount);
      SupportContacts.ItemStyle.Wrap = true;
      SupportContacts.Width = tableWidth;
      SupportContacts.DataSource = dtTable;
      SupportContacts.DataBind();
  </code></pre>