Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get grid's column widths
Message
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
00962477
Message ID:
00962755
Vues:
12
Hector,
Thanks for your reply. I downloaded your example but I noticed that I need to have SQL server installed (or MSDE) (I guess I will need to install MSDE eventually).
I dug into your code and found that I think I am doing it the same way you are.
Here is your VB.NET code lifted from the download
For Each GridColumn In Grid.TableStyles.Item(0).GridColumnStyles
  // some stuff
Next
Here is my C# code (I think I am doing the same thing, please let me know if my C# code is not comparable):
foreach (System.Windows.Forms.DataGridColumnStyle dgcs in this.dataGrid2.TableStyles[0].GridColumnStyles)
{
  MessageBox.Show(dgcs.Width.ToString());
}
Now when I run my code I get several messageboxes displaying me the width of the columns, but if I change the width of the columns in my datagrid and execute the code again the column width's in the msgbox is the same. In fact even when I start my application the column widths are still the default column width (75 I think).

Please let me know what you think.

Thanks,
Einar





>I wrote something like that and it is available on GotDotNet
>
>http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=c70c9240-d404-4f5c-b2fc-45475ef1eeb0
>
>It's an incomplete implementation, but it might give you some ideas.
>
>
>>I am working on saving the column widths (along with other things) in my grid to a XML file. I will use this information when the app is started to return everything (almost) to the same way as the user left it. I am having some problems finding where the grid's column width is located.
>>Any help would be appreciated.
>>
>>Thanks,
>>Einar
Semper ubi sub ubi.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform