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

How to change the OrderIndex?

4 Answers 218 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Roxane
Top achievements
Rank 1
Roxane asked on 09 Jun 2015, 12:32 PM

Hello Telerik-Team,

we have the following code, to change the OrderIndex of our custom bounded columns

int index = 999;
int i = 0;
while (i < collection.Keys.Count-1)
{
    grid.MasterTableView.GetColumnSafe(collection.Keys.ToList()[i]).OrderIndex = index;
    i ++;
    index++;
}

 

The problem is, that the first column of the collection will not be changed, because of the "-1". But when we remove the "-1", all columns go back to the old position at the beginning of the grid. We want to have our custom columns at the end of the table. (After the auto generated columns).

Can you give us a hint, to solve the problem?

 

 

4 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 12 Jun 2015, 12:40 PM
Hi Roxane,

I am sending a sample RadGrid web site to demonstrate how you can achieve this requirement. Please run the attached application and let me know if it helps you.

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Roxane
Top achievements
Rank 1
answered on 16 Jun 2015, 11:58 AM

Hello Eyup,

thanks for you answer, but that does not solve our problem. When we changed the index of alle custom created columns, all columns go back to the old position. 

We want to set the custom created columns at the end of the Grid.

 

0
Eyup
Telerik team
answered on 19 Jun 2015, 09:18 AM
Hi Roxane,

By default, the auto-generated columns appear after the declaratively defined columns in the aspx page. The demonstrated approach in the sample changes this behavior backwards, i.e. the manually created columns will appear last.

If you have different requirements or further instructions, please elaborate on your specific scenario and send us sample screenshots or video demonstrating the desired behavior. You can also modify the sample to simulate your own case and open a formal support ticket to send it back to us.

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Roxane
Top achievements
Rank 1
answered on 19 Jun 2015, 09:53 AM

Hello Eyup ,

we solved the problem by changing all OrderIndexes.

 Thanks for you help.

Tags
Grid
Asked by
Roxane
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Roxane
Top achievements
Rank 1
Share this question
or