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:
00963044
Vues:
8
Kevin,
I noticed from Cetin's post and from your code example that I had not specified a mappingname. I added the mapping name using the designer, but it still did not work.
I created a little gridtest project where I could play around with the grid. I did everything in code and it worked the way I wanted it.

"Real programmers do not use the designer" :)

Anyways thanks for all your help with this problem.

Sincerely,
Einar


>Hi, Einar,
>
>If you haven't added a tablestyle, then you'll have to do something different.
>
>The grid class from my article grid project automatically creates one, based on the column definitions you supply it.
>
>If you're not explicitly using that class, if you're using your own, you'd have to do something like...
>
>
>DataGridTableStyle style = new DataGridTableStyle();
>style.MappingName = "MyDataTableName";
>
>DataGridTextBoxColumn fld1 = new DataGridTextBoxColumn();
>fld1.HeaderText = "Job #";
>fld1.MappingName = "JobNumber";
>fld1.Width = 55;
>
>DataGridTextBoxColumn fld2 = new DataGridTextBoxColumn();
>fld2.HeaderText = "Job Description";
>fld2.MappingName = "Descript";
>fld2.Width = 115;
>
>style.GridColumnStyles.AddRange(new DataGridColumnStyle[] {fld1, fld2 });
>
>myGrid.TableStyles.Clear();
>myGrid.TableStyles.Add(style);
>
>
>Then you'll have a tablestyle.
>
>Kevin
Semper ubi sub ubi.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform