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

[Solved] manually added column doesn't get added as last column

1 Answer 50 Views
Grid
This is a migrated thread and some comments may be shown as answers.
bgoldca
Top achievements
Rank 1
bgoldca asked on 01 Oct 2009, 05:16 PM
I have a RadGrid that I'm building manually using a series of Grid.MasterTableView.Columns.Add(boundColumn) commands. Everything works great when the grid is initially being built. Then depending upon user actions I add additional columns to the grid in the same manner. This works well. But if I add a column and the user moves (resequences) that column, then the next time a add a column it's not appended as the last column - it shows up after the previously added column.

So let's say I have a grid like this:
NAME ID ADRESS

Then programmatically I add phone. The grid now looks like this:
NAME ID ADRESS PHONE

Now the user drags PHONE to the left and makes it the first column:
PHONE NAME ID ADRESS

Now I programmatically add another column TITLE (using columns.add) and instead of appearing as the last column it appears after PHONE:

PHONE TITLE NAME ID ADRESS

Is there any way to always have columns appear as the last column as they're added?

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 06 Oct 2009, 02:54 PM
Hi Ben,

You can try to set column.OrderIndex in order to place the lastly added column into the end of the RenderColumns collection.

All the best,
Georgi Krustev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
bgoldca
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or