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

Sorting Expression on a Column

3 Answers 84 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Nikhil Jain
Top achievements
Rank 1
Nikhil Jain asked on 17 Dec 2010, 01:14 PM
Hi

I want to know. How can I apply Sorting on a Column by default when grid load. If I want that on a column "Customer Name" than How will I do this.

3 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 17 Dec 2010, 01:33 PM
Hello Nikhil Jain,

You can define a SortDecscriptor in the XAML or in the code behind as shown here.

Regards,
Veselin Vasilev
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Nikhil Jain
Top achievements
Rank 1
answered on 17 Dec 2010, 01:46 PM
This is not working . I had applied it

 

 

 

<telerik:RadGridView.SortDescriptors>

 

 

 

 

<telerik:SortDescriptor Member="Customer" SortDirection="Ascending" />

 

 

 

 

</telerik:RadGridView.SortDescriptors>

 

 

 

 

<telerik:RadGridView.Columns>

 

 

 

 

    <telerik:GridViewDataColumn Header="Customer" DataMemberBinding="{Binding ShipToName}" Width="*" TextWrapping="Wrap" />

 

 

 

 

</telerik:RadGridView.Columns>

 



0
Veselin Vasilev
Telerik team
answered on 17 Dec 2010, 02:07 PM
Hi Nikhil Jain,

You set the member to "Customer", but do you have such a property?
The column is bound to the ShipToName property, maybe you want to sort by it? If so, set it to the Member property of the SortDescriptor.

All the best,
Veselin Vasilev
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
Tags
GridView
Asked by
Nikhil Jain
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Nikhil Jain
Top achievements
Rank 1
Share this question
or