Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GridColumnStyles doesn't have an indexer?!?!?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Titre:
GridColumnStyles doesn't have an indexer?!?!?
Divers
Thread ID:
00963489
Message ID:
00963489
Vues:
42
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.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform