I've implemented a hierarchical grid and have used the checkbox sample as a baseline. The problem I'm having is that each of my headers (n-level) need to call their appropriapte View Model to do the checking/unchecking of their children.
<CheckBox HorizontalAlignment="Center" VerticalAlignment="Center" IsChecked="{Binding ???" />
Each level ViewModel contains a list and a bool field. I have tried several things but cannot seem to get the right object reference.
Any ideas or suggestions?
chr15t1an
Hello,One possible implementation can be different styles for the HeaderPrefixAreaStyle and RecordSelectorStyle for each hierarchy level.For example we have a 2 level hierarchy - class Person which has a collection of friends List<Friend>. Both Person and Friend classes have IsSelected property (IsPSelected and IsFSelected).<igDP:FieldLayout> <igDP:FieldLayout.Settings> <igDP:FieldLayoutSettings
HeaderPrefixAreaStyle="{StaticResource headerPrefixAreaStyle1}" RecordSelectorStyle="{StaticResource recordSelectorStyle1}"/> </igDP:FieldLayout.Settings> <igDP:FieldLayout.Fields > <igDP:Field Name="PLastName" Label="Parent Last name" /> <igDP:Field Name="PFirstName" Label="Parent First name" /> <igDP:Field Name="PFriends" Label="friends"/> <igDP:Field Name="IsPSelected" Visibility="Collapsed" /> </igDP:FieldLayout.Fields></igDP:FieldLayout><igDP:FieldLayout> <igDP:FieldLayout.Settings> <igDP:FieldLayoutSettings
HeaderPrefixAreaStyle="{StaticResource headerPrefixAreaStyle2}" RecordSelectorStyle="{StaticResource recordSelectorStyle2}"/> </igDP:FieldLayout.Settings> <igDP:FieldLayout.Fields > <igDP:Field Name="FLastName" Label="friend last name" /> <igDP:Field Name="FFirstName" Label="friend first name" /> <igDP:Field Name="IsFSelected" Visibility="Collapsed" /> </igDP:FieldLayout.Fields> </igDP:FieldLayout> For more details i've attached a sample project.
Hope this helpsRegardsVlad.
Is there a way to modify the style such that when the check box in the row selecter is checked, the row it belongs to is made the Active row?
As far as I understand, you want to mark the row as active row of the grid if you click on the checkbox in the rowselector. Tbh you make the row active when you click on any of it's cells, so I don't see the point of it.
If I were you I would not use checkbox, but radiobutton here, because there could be only one active row in the grid. Besides setting the record's IsActive property to true, you have to set the grid's ActiveRecord property to the record you want.