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

Show Sort Order With MultiColumn Sorting

3 Answers 108 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joshua Owen
Top achievements
Rank 1
Joshua Owen asked on 14 Sep 2009, 01:56 PM
Hello,

We are trying to show the sort order in our RadGrid when the grid is sorted by multiple columns.  We would like to use an integer in front of the column header text to show if it is the primary, secondary, or tertiary sort parameter.  Is this currently possible?

Thanks & Regards,
Josh Owen

3 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 17 Sep 2009, 06:47 AM
Hi Joshua,

Attached to this message, is a small application, which handles a similar task. I hope it gets you started properly.

Sincerely yours,
Yavor
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.
0
JP
Top achievements
Rank 1
answered on 29 Mar 2012, 01:14 PM
Hi,

I just implemented that feature and it works fine except when I reorder the columns (drag&drop).
The Grid's PreRender event is fired and the Label is added to all columns with a sort, but it isn't visible on the client. After another sort operation (or group) the sort order is visible again.

Do you have an idea why this just happens after column reorder?
These are my settings for reordering:
ClientSettings.AllowColumnsReorder = true;
ClientSettings.ReorderColumnsOnClient = false;
ClientSettings.ColumnsReorderMethod = GridClientSettings.GridColumnsReorderMethod.Reorder;

I have to do it server side so I can save the column order to database.
I also set "EnableColumnsViewState" to false because I add/remove columns at runtime (which works perfectly).

I have seen that when the columns are reordered, the NeedDataSource event is fired after RadGridPreRender. Maybe the setting of the Grid's DataSource is responsible for that behavior?

Thanks for your help!
0
Tsvetina
Telerik team
answered on 04 Apr 2012, 09:15 AM
Hello Jan-Patrick,

You could try moving your logic to the DataBound event handler of RadGrid. I tested this in my colleague's project and it worked as expected.

Kind regards,
Tsvetina
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
Joshua Owen
Top achievements
Rank 1
Answers by
Yavor
Telerik team
JP
Top achievements
Rank 1
Tsvetina
Telerik team
Share this question
or