Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do I set a column to be the default sort column with Telerik RadGridView in Silverlight

I have a RadGridView control in a silverlight project and would like to have the grid come up sorted by the name column. I tried placing the attribute SortingState="Ascending" on the column definition for the name. I do not see any other attributes that might accomplish this. Does anyone know how to make this happen?

like image 307
dna86 Avatar asked Feb 16 '11 21:02

dna86


2 Answers

You will want to add a SortDescriptor to the grid

<telerik:RadGridView.SortDescriptors>
    <telerik:SortDescriptor Member="Name" SortDirection="Ascending" />
</telerik:RadGridView.SortDescriptors>
like image 194
Matt Greer Avatar answered Nov 16 '22 23:11

Matt Greer


Also, what about the 'ColumnSortDescriptor'?

http://demos.telerik.com/silverlight/#GridView/Sorting

There are examples and code there.

like image 1
peteski Avatar answered Nov 16 '22 23:11

peteski