I have a datagrid bound to PagedCollectionView which is based on an observable collection. I am grouping the data based on one column. I am trying to customize the row group header. I have Text Block which binds to the Name property of the group and a checkbox to allow user to select all the rows in the group. This is my custom header XAML.
<CheckBox Height="30" Width="30" Click="chekClick" ></CheckBox> <TextBlock Margin="4,0,0,0" Text="{Binding Name}" Foreground="#FFEEEEEE"/>
Everything works well. The problem is with the Checkbox. If I check the checkbox for any one of the groups and when I scroll down the datgrid , checkbox for some other group's also get checked. I understand that this is the effect of virtualization concept in Silverlight. I know I can avoid this if I use binding for the checkbox.
But the problem is I dont know how can I bind this because the Datacontext of the Rowgroup header is "CollectionViewGroup" . Is there a way I can inject a property such as 'IsGroupSelected 'for the each group of the data so that I can bind the checkbox as well. Thanks Jaleel
No comments:
Post a Comment
Send us your comment related to the topic mentioned on the blog