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

Setting initial sort?

2 Answers 80 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 02 Nov 2012, 04:22 PM
I have a RadGridView, which is bound to a QueryableCollectionView.

I want the customer to be able to take full advantage of sorting, grouping, etc. But there is a default multi-column sort I want to start them off with.

As an example, suppose each record has a ticket number, a priority, and a date.  When they turn off all sorting on the grid, the rows should be sorted by ticket number. But I want the grid to start out sorted by priority and then date.

And an additional complication - the columns are dynamically created, populated in code, not in XAML.  I've tried setting SortingState as I add the columns, but it doesn't seem to "stick".

2 Answers, 1 is accepted

Sort by
0
Accepted
Yoan
Telerik team
answered on 07 Nov 2012, 04:13 PM
Hi Jeffrey,


I have prepared a sample project that meets your requirements. Please find it attached.

I suggest you to check this help article, where you can find information about programmatic sorting.

 

All the best,
Yoan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Jeff
Top achievements
Rank 1
answered on 07 Nov 2012, 04:51 PM
That's exactly what I was looking for.  Thanks.
Tags
GridView
Asked by
Jeff
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Jeff
Top achievements
Rank 1
Share this question
or