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

GridViewSelectColumn and IsFilterable

1 Answer 176 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mikael
Top achievements
Rank 1
Mikael asked on 15 Dec 2015, 12:52 PM

Hi,

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

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 17 Dec 2015, 04:10 PM
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}"/>
</Style>

I hope this helps.

Regards,
Stefan X1
Telerik
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
Tags
GridView
Asked by
Mikael
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or