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

Checkbox column in GridView using MVVM

1 Answer 221 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 17 May 2011, 08:47 PM
<telerik:GridViewColumn>
<telerik:GridViewColumn.Header>
   <CheckBox x:Name="ckbSelectAll" IsChecked="{Binding ElementName=LayoutRoot, Path=DataContext.SelectAll}" IsThreeState="False">
 </CheckBox>
</telerik:GridViewColumn.Header>
<telerik:GridViewColumn.CellTemplate>
   <DataTemplate>
       <CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay}" />
   </DataTemplate>
</telerik:GridViewColumn.CellTemplate>
</telerik:GridViewColumn>

I have the following column in my RadGridView.  I want to be able to select all columns based on a checkbox in the header or select single columns via a checkbox in the row.  The 'IsSelected' property is working as it I would expect, however the SelectAll property is not.  SHOULD I be able to bind this property?  I get no binding errors but also see no response to a change in the IsChecked property.

I can't use a GridViewSelectColumn b/c I need to be able to get the result of the checkboxes in my view model.

Any ideas how to accomplish this?
Tks.

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 18 May 2011, 07:19 AM
Hi,

 Please check this blog post to know more about how to achieve such synchronization. 

Kind regards,
Vlad
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Brian
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or