Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
445
How to bind CheckboxField checked property with command located in ViewModel.
posted

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.

Parents
No Data
Reply
  • 445
    Offline posted

    Hello. 

    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>

Children