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