Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get grid's column widths
Message
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00962477
Message ID:
00962645
Views:
10
Hi, Einar,

If you haven't added a tablestyle, then you'll have to do something different.

The grid class from my article grid project automatically creates one, based on the column definitions you supply it.

If you're not explicitly using that class, if you're using your own, you'd have to do something like...
DataGridTableStyle style = new DataGridTableStyle();
style.MappingName = "MyDataTableName";

DataGridTextBoxColumn fld1 = new DataGridTextBoxColumn(); 
fld1.HeaderText = "Job #";
fld1.MappingName = "JobNumber";
fld1.Width = 55;

DataGridTextBoxColumn fld2 = new DataGridTextBoxColumn();
fld2.HeaderText = "Job Description";
fld2.MappingName = "Descript";
fld2.Width = 115;

style.GridColumnStyles.AddRange(new DataGridColumnStyle[] {fld1, fld2 });

myGrid.TableStyles.Clear();
myGrid.TableStyles.Add(style);
Then you'll have a tablestyle.

Kevin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform