GridViewSelectColumn and IsFilterable

2 posts, 0 answers
  1. Mikael
    Mikael avatar
    1 posts
    Member since:
    Apr 2009

    Posted 15 Dec 2015 Link to this post


    We have a regular GridViewSelectColumn as the left-most column in a RadGridView. The users have requested that they want to filter the grid by that column, but when I add IsFilterable="True" to it, nothing happens. No filter icon appears in the header.

    Is this not possible or have I just made some mistake here?

    Best regards
    Mikael Börjesson

  2. Stefan X1
    Stefan X1 avatar
    486 posts

    Posted 17 Dec 2015 Link to this post

    Hi Mikael,

    By default, GridViewSelectColumn does not support DataMemberBinding, so data operations such as filtering is not supported by it. Its only purpose is to select a given row, so its CheckBox's IsChecked property is internally bound to the IsSelected property of GridViewRow.

    So, for this scenario you can use the approach demonstrated in the CheckBoxColumn with CheckBox Header forum thread. The main idea for using custom GridViewCheckBoxColumn is that it supports DataMemberBinding. So, if we assume that you define a boolean IsChecked property in your business model, you can bind the DataMemberBinding property of the custom CheckBox column to it. Finally, you should define a Style that sets the IsSelected property of GridViewRow to be bound to the aforementioned boolean one of the business model.
    <Style TargetType="telerik:GridViewRow">
        <Setter Property="IsSelected"
                Value="{Binding IsChecked, Mode=TwoWay}"/>

    I hope this helps.

    Stefan X1
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
Back to Top