Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GridColumnStyles doesn't have an indexer?!?!?
Message
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00963489
Message ID:
00963507
Views:
7
Hi Einar,

The indexer is read-only which is why the messagebox worked.

>the watch window tells me that: GridColumnStyles doesn't have an indexer?!?!?
>Now I believe that this is wrong, because I have and can still use it's indexer there is just one thing that I can not use it's indexer for.
>
>I am using the GridColumnStyles indexer when I am writing the column widths to a XML file:
>
>wtr.WriteElementString("Width", this.dataGrid1.TableStyles[0].GridColumnStyles[i].Width.ToString());
>
>
>but When I try to read from the XML file and assign the saved column with back to the datagrid column
>
>this.dataGrid1.TableStyles[0].GridColumnStyles[iCounter].Width = Convert.ToInt16(rdr.Value);
>
>this line throws an exception stating that GridColumnStyles doesn't have an indexer.
>
>Now here comes the wierd part. If I replace the line above with a messagebox it works (well the assignment doesn't work but I get messageboxes with the column's width)
>
>MessageBox.Show(this.dataGrid1.TableStyles[0].GridColumnStyles[iCounter].Width.ToString());
>//this.dataGrid1.TableStyles[0].GridColumnStyles[iCounter].Width = Convert.ToInt16(rdr.Value);
>
>
>Is there something I am missing?
>
>Thanks,
>Einar
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform