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:
00963519
Views:
7
Cathi,
Thanks for your reply. Hmm I guess I still do not understand why I can not change the Width property even if the indexer is read-only.

How can I otherwise update the column width at run-time?

Thanks,
Einar

>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
Semper ubi sub ubi.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform