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

Sorting by selection status via an additional column

2 Answers 13 Views
GridView
This is a migrated thread and some comments may be shown as answers.
allSEASON
Top achievements
Rank 1
allSEASON asked on 14 Dec 2009, 03:33 AM

I have a column with a checkbox in it which will reflect the selection status of the row. This column is added via the xmal and the other columns are binding to the data source.

 

Same implementation as the following link:

http://www.telerik.com/community/forums/wpf/gridview/button-and-checkbox-on-row.aspx

 

They work very well and only one issue for me. I can sort other columns by default, but nothing happen when I click the header of the checkbox column, neither the colour will change when I move the mouse over it like other columns.

 

Is it possible to sort the grid be selection status of the rows (true or false) when I click the header of this column, just like a REAL data column?

 

Many thanks!

John

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 14 Dec 2009, 07:13 AM
Hi John,

 Since this is GridViewDataColumn you can declare DataMemberBinding or SortMemberPath to achieve your goal. As for the sorting on IsSelected GridViewRow property you can declare similar property in your view model, synchronize this property value with IsSelected GridViewRow property and set this as DataMemberBinding or SortMemberPath.


Greetings,
Vlad
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
allSEASON
Top achievements
Rank 1
answered on 14 Dec 2009, 11:58 PM
Thanks Vlad! It works perfectly after the binding changes.
Tags
GridView
Asked by
allSEASON
Top achievements
Rank 1
Answers by
Vlad
Telerik team
allSEASON
Top achievements
Rank 1
Share this question
or