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…)
Thanks!
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();
You could try the following (although I’m not sure if it will let you when you are auto-generating your columns).