This is a migrated thread and some comments may be shown as answers.

Columns added in alphabetical order

2 Answers 58 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Marc Roussel
Top achievements
Rank 2
Marc Roussel asked on 15 Oct 2010, 09:02 PM
Hi,

When the grid uses AutoGenetatedColumns = true, it populates the grid with the properties in alphabetical order
Is there a way to avoid this and let the order in which the properties are in the class ?

Os is there a way to set an attribute on the property to make it a certain index ?

Actually I have [DataMember] attribute on each property of course
Thank for any hints on this

2 Answers, 1 is accepted

Sort by
0
Marc Roussel
Top achievements
Rank 2
answered on 17 Oct 2010, 11:17 AM
The attribute order did work.
[DataMember(Order = 9)]
0
Lasse
Top achievements
Rank 1
answered on 21 Dec 2011, 04:04 PM
How did you get that to work, I tried the same, editing the service.metadata.cs, but it still sorts them alfabetically - rather annoying.

I even tried reordering the attributes in the meta class, but that didn't work either...
Tags
GridView
Asked by
Marc Roussel
Top achievements
Rank 2
Answers by
Marc Roussel
Top achievements
Rank 2
Lasse
Top achievements
Rank 1
Share this question
or