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

RadGridView custom boolean column filter

0 Answers 125 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Garry
Top achievements
Rank 1
Garry asked on 16 Nov 2012, 11:16 PM
I have a Silverlight RadGridView with a column of type GridViewCheckBoxColumn. We have a user requirement that this CheckBox column be filterable but instead of "True" and "False" displayed by the filter as the distinct values the requirement is for the filter to display "Checked" and "Unchecked". Is there a simple solution for this where a CheckBox control is used in the grid but "Checked" and "Unchecked" are displayed in the filter?

After additional searching through this forum, I came across an entry that solved my problem:
GridView filtering with distinct values and converter

My view model has a property called IsVisible that is bound to the column by:

DataMemberBinding="{Binding IsVisible, Mode=TwoWay}"

I added a new readonly property, IsVisibleCheckedUnchecked, on the view model:
public String IsVisibleCheckedUnchecked { get { return IsVisible ? "Checked" : "Unchecked"; } }
 
And added FilterMemberPath="IsVisibleCheckedUnchecked" to the column in the view.

That's it... works great.

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Garry
Top achievements
Rank 1
Share this question
or