Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get grid's column widths
Message
From
18/11/2004 18:35:34
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00962477
Message ID:
00962859
Views:
9
>Kevin,
>There is not a whole lot of code. I have mostly just added properties to the property window for the grid. The only properties I have changed for the datagrid is:
>
>DataSource: I selected dataTable1
>ReadOnly: I changed this to True
>TableStyles: I clicked the <b>...</b>-button and added a tablestyle
>  GridColumnStyle: I clicked the <b>...</b>-button and added 16 gridcolumnstyles
>    For each of the dataGridTextBoxColumns (1-16) I set the Width property to a different value
>
>
>I could send you the cs file off-line if you would like to take a look at it.
>
>Thanks,
>Einar
>
>
>>Hey, Einar,
>>
>>Might be easier if you post the code. If you can do that, it might make it easier to track down.
>>
>>Thanks,
>>Kevin


Einar,
You set the width properties but did you also set MappingName ? Probably that style is not used at all. If in use you should get the widths as you resize:
foreach(DataGridColumnStyle dcs in dataGrid1.TableStyles[0].GridColumnStyles)
{
	MessageBox.Show( String.Format (
       "Column header:{0}\nColumn source:{1}\nColumn width:{2}",
	dcs.HeaderText,dcs.MappingName,dcs.Width));
}
Check if mappingname (Column Source) is empty or not.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform