Hello.
I would like to hook checked or unchecked status of the checkbox field of xamTreeGrid and handle it in a ViewModel using command.
But I can't find any event or property which CheckboxField of xamTreeGrid provide. Please let me know what to do.
Below are something I want. (See bold area)
<igWPF:XamTreeGrid DataSource="{Binding Path=GroupItems}">
<igWPF:XamTreeGrid.FieldLayouts>
<igWPF:CheckBoxField Label="Selection" Name="IsChecked" Width="Auto" AllowEdit="True" IsThreeState="True" CheckedStatusChanged={binding DataContext.XXXCommand >
<igWPF:CheckBoxField.Settings>
<igWPF:FieldSettings xxxxxxx/>
Thank you in advanced.
I might find work-around with below But I stuck in again because I don't know how to retain the style.
Once I applied below, I can't retain the style of the checkboxField so that It looks like natural checkbox which don't have xamTreeGrid styling
such as a theme appled in xamTreeGrid. Please somebody help me how to solve this. I want to retain the original xamTreeGrid checkboxField style.
<igWPF:FieldLayout Key="NetItem"> <igWPF:CheckBoxField Name="IsChecked" Label="Selection" Width="Auto" AllowEdit="True" IsThreeState="False"> <igWPF:CheckBoxField.Settings> <igWPF:FieldSettings > <igWPF:FieldSettings.CellValuePresenterStyle> <Style TargetType="{x:Type igDP:CellValuePresenter}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}"> <CheckBox Command="{Binding ElementName=_netlistView, Path=DataContext.CheckboxCheckedCommand}" CommandParameter="{Binding}" IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Value}"/> </ControlTemplate> </Setter.Value> </Setter> </Style> </igWPF:FieldSettings.CellValuePresenterStyle> </igWPF:FieldSettings> </igWPF:CheckBoxField.Settings> </igWPF:CheckBoxField>
Hello jswpro,
Thank you for your post(s).
I have been investigating into this, and the CellValuePresenter template that you are using can work, but the reason that your checkbox is not holding the same style as the one in the CheckboxField is because the default editor of a CheckboxField is not the built-in WPF Checkbox - it is a XamCheckEditor, and so I would recommend replacing the Checkbox in your template with a XamCheckEditor if you would like to retain the style that is in the CheckboxField.
Now, you are also going to need to modify your bindings, as the XamCheckEditor doesn't have a default "Command" property to bind to, which fires when it is checked. Instead, I would recommend using the System.Windows.Interactivity assembly to define an Interaction.Triggers collection for your XamCheckEditor in the template, and then define an EventTrigger for the XamCheckEditor's ValueChanged event. From here, you can use the interactivity library again with its InvokeCommandAction class to invoke your command with the parameters you are looking for.
I have attached a sample project to demonstrate the above. I hope this helps you.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
I'm attaching the picture for the issue 1.
Hello Andrew.
Thank you for your feedback. I'll really help.
But There Two problem on this.
One is when you appled Office2013 Theme on xamTreegrid in xaml, the isChecked column styles such as border style is disappear.
Please help me on this. We're applying Office2013 theme in xamtreegrid.
Second thing is about ValueChanged Event. Actually My program has 2-depth tree structure, So I used two xamTreeGrids, one for parentNode, one for children node(Binding type is set to default).
And After your guide I set two style one for parentNode, one for children node. What I expect was When I check parentNode or child node, I get the mapping command from ViewModel via style. But strange thing is that the command is calling also when the expanding mark of the parent node is clicked via that path. It was called for the expanding parent node and the all sub children node. More strange behavior is that this happen just once when you expand any of parent node for the first time.
thanks you in advance.