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

[Solved] Determining column order after user reorders columns

1 Answer 84 Views
Grid
This is a migrated thread and some comments may be shown as answers.
bgoldca
Top achievements
Rank 1
bgoldca asked on 15 Sep 2009, 05:35 PM
I have a grid that allows the user to reorder columns. I've set AllowColumnsReorder to true, which allows the user to drag and drop to reorder columns, but I'm not sure how I can tell what order the columns are in after the user is done. Can I figure that out by iterating through the Columns collection to find the order of the columns? If so, how would I do that? Alternatively, is there an event that fires when a column is reordered? Should I keep track of the column order using that event?

Thanks!

1 Answer, 1 is accepted

Sort by
0
Schlurk
Top achievements
Rank 2
answered on 15 Sep 2009, 07:22 PM
You could get the columns collection and cycle through them, recording somewhere (an array for example), what the order is. This way you do get a list of the order they are in (although it is fairly simple). Take a look at this documentation article for some more references. You could also take a look at these client-side events which might help depending on your implementation:
OnColumnSwapped
OnColumnMovedToLeft
OnColumnMovedToRight

Tags
Grid
Asked by
bgoldca
Top achievements
Rank 1
Answers by
Schlurk
Top achievements
Rank 2
Share this question
or