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

Feature Request - Reorder Columns on Server Side

0 Answers 55 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Casey
Top achievements
Rank 1
Casey asked on 22 Jun 2012, 04:39 PM
Hello,

I think that it would be very helpful to have a .Reorder method for the RadGrid to enable column reordering on the server side. I know that there is a .SwapColumns method, but this doesn't provide the functionality desired, unless you loop through all of the columns and add swap the column position with every column until the column you want is at the end.

If I have a RadGrid with AutoGenerateColumns, and I have a TemplateColumn I want to display at the beginning of the RadGrid, and another TemplateColumn I want to display at the end, I have to add both columns to the RadGrid in the page load, and then in the PreRender I have to use the SwapColumns method to swap the column with each column next to it, until it is at the end. It would be so much easier if there was a .Reorder method where I could just pass the index of the column I want to move, and the new index where I want to column to move to.

Something like the following: 
RadGrid1.MasterTableView.Reorder(RadGrid1.MasterTableView.GetColumnSafe("TemplateCol2").OrderIndex,
 RadGrid1.MasterTableView.RenderColumns.Length - 1);

I would think that this would be more practical than using the SwapColumns method, since SwapColumns would just switch the TemplateCol2 column with whatever column was the last column of the RadGrid.

Thanks!
Casey

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Casey
Top achievements
Rank 1
Share this question
or