I am using XamDataTree and have three level of heirarchy on the tree view
Parent
- Child
- - Symbol
My Xaml looks something like below
<ig:XamDataTree Grid.Row="3" x:Name="FilterTree" VerticalAlignment="Stretch" VerticalContentAlignment="Stretch">
<ig:XamDataTree.CheckBoxSettings> <ig:CheckBoxSettings IsCheckBoxThreeState="True" CheckBoxVisibility="Visible" CheckBoxMode="Auto"/> </ig:XamDataTree.CheckBoxSettings> <ig:XamDataTree.GlobalNodeLayouts> <ig:NodeLayout Key="Grouped" TargetTypeName="ParentNode" DisplayMemberPath="Title"> </ig:NodeLayout> <ig:NodeLayout Key="L2" TargetTypeName="ChildNode" DisplayMemberPath="Title"> </ig:NodeLayout> <ig:NodeLayout Key="SymbolNodeKey" TargetTypeName="SymbolNode" CheckBoxMemberPath="IsChecked" DisplayMemberPath="Title"> </ig:NodeLayout> </ig:XamDataTree.GlobalNodeLayouts> </ig:XamDataTree>
As you can see i am binding IsChecked member path to the leaf node's CheckBoxMemeberPath, the binding works well and I can see checkbox gets enable/disable from the code behind, the problem is that the parent node of the leaf does not automatically gets checked/unchecked when the leaf gets checked/unchecked from the code behind (the xamdatatree checkbox setting is in auto mode).
Can you suggest if it is a bug or if i am missing something? (please do not tell me that you'd expect users to maintain and enable/disable all parent nodes, if this is the case how can i set a parent node to be in a semi checked state i.e. when not all but only a few child nodes are checked).
Thanks
Hello,
Thank you for your post. I have been looking into it and have created a small sample for you. In the sample application I use a button to check a node. When a node is checked the parent layout gets expanded. In the sample application I bind the ChackBoxMemberPaht to the child layout. The IsCheckBoxThreeState is used when the CheckBoxMode is set to manual. Here is a link to our documentation, where you can find more information about this functionality: http://help.infragistics.com/Help/NetAdvantage/WPF/2013.1/CLR4.0/html/xamDataTree_xamDataTree_Check_Boxes.html.
Please refer to the attached sample application and feel free to let me know if you have any further questions on the matter.
Hi Gergana,
Thanks so much for looking into it, the problem is that I am using MVVM framework and I cannot directly have reference to the xamdatatree. I have modified your application to reflect that. I have added two properties "expanded" and "checked" on the Product/Category class and bounded it via IsExpandedMemberPath and CheckBoxMemberPath. When i click on the button right after the application loads, this is what I see.
If i expand the Beverage node first manually and then click on the button, the parent node gets checked perfectly.
How can i also check/uncheck the parent nodes when i check/uncheck only the leaf node, all by using only the binding on the itemsource and not by holding direct reference to xamdatatree?