RadGridView custom boolean column filter

1 posts, 0 answers
  1. Garry
    Garry avatar
    1 posts
    Member since:
    Nov 2012

    Posted 16 Nov 2012 Link to this post

    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.

Back to Top