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

RadGrid Column order index

3 Answers 585 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sophie
Top achievements
Rank 2
Sophie asked on 21 Jan 2013, 05:59 PM
Hello, I'm having issues with the order index of my grid's columns.
I am saving the grid settings in a session variable, with the class provided here. I added a debug to see what is happening.
During the save, after i moved some column, i get this output:
Protected Overridable Sub SaveColumnSettings()
  Settings.ColumnSettings.Clear()
  Dim i = 0
  For Each column As GridColumn In Grid.MasterTableView.Columns
    Debug.Print("column no " + i.ToString() + " with OrderIndex " + column.OrderIndex.ToString())
     i += 1
    Settings.ColumnSettings.Add(GetColumnSettings(column))
  Next
.....
Output:
column no 0 with OrderIndex 2
column no 1 with OrderIndex 3
column no 2 with OrderIndex 4
column no 3 with OrderIndex 5
column no 4 with OrderIndex 6
column no 5 with OrderIndex 7.....

My grid have those settings:
<ClientSettings EnableRowHoverStyle="true"
  AllowColumnsReorder="true"
  ReorderColumnsOnClient="true"
  AllowDragToGroup="false"
  ColumnsReorderMethod="Reorder"
  AllowColumnHide="true"
  Selecting-AllowRowSelect="false">
 and my masterTableView has those settings:
<MasterTableView AllowMultiColumnSorting="false" AllowNaturalSort="true" AllowCustomSorting="true" AllowCustomPaging="true" .... >.....

Is it normal to get OrderIndex always in the same order? Does that explain why i load my grid settings i always get default order?
I save column slection too, that works really well, saved in session and saved in database. But OrderIndex... always in this order.

Anything im missing?


EDIT: i missed something... wether you hide or show a column, the order Index is always in order.
Then, any idea on how am i going to save the indexOrder of the column in my database?

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 24 Jan 2013, 03:22 PM
Hello Sophie,

I just tested this functionality on my end but I failed to reproduce the problem. When I moved one of the columns I got the following output:

column no 0 with OrderIndex 3
column no 1 with OrderIndex 4
column no 2 with OrderIndex 5
column no 3 with OrderIndex 6
column no 4 with OrderIndex 2

Could you please try to isolate the problem in a runnable sample so that I can debug it locally?

Kind regards,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Sophie
Top achievements
Rank 2
answered on 24 Jan 2013, 06:00 PM
Hello Daniel,
my team and i are currently doing a code review to try to find the problem. If we don't find it, ill create a sample to illustrate my problem, otherwise ill post the solution we find. Thanks.

Edit: A did a sample demo and everything works as expected. Might be a postback issue with Ajax in our project. We're still investigating the issue.
0
Daniel
Telerik team
answered on 29 Jan 2013, 05:17 PM
Hello Sophie,

If you manage to reproduce the problem you can submit a support ticket with the demo project attached.

Kind regards,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Sophie
Top achievements
Rank 2
Answers by
Daniel
Telerik team
Sophie
Top achievements
Rank 2
Share this question
or