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
Hi,
Could you please give any tentative dates when this issue will be picked up, I am required to hide the tree view inside an expander and until the view is visible, i cannot set the nodes checked.
Hi Krasimir,
That is exactly what i am doing, i reported the same issue but differently and your colleague helped me understand that xamdatatree uses two passes, in one pass it does the layout/arrange and only after that checkbox binding works. Currently the above meachanism does work but gives me some threading issues which i have fixed via hacks. I look forward if infragistics could fix it so i could remove the ugly hacks (i need to check and uncheck the nodes prgramatically and causes race).
Thanks,
Rohit
Hello,
Thank you for your post. I have logged this behavior with our developers in our tracking system, with an issue ID of 144932. I have also created a support ticket on your behalf with number CAS-118059-S8W0K7 in order to link the development issue to it so that you are automatically updated when a Service Release containing your fix is available for download.
Currently, you can avoid this behavior by setting the Checked property in a Dispatcher, to allow the child node to be drawn before checking it. Here is how you can change the sample to implement this approach:
DataUtil.CategoriesAndProducts[0].Expanded = true;
Dispatcher.CurrentDispatcher.BeginInvoke(new Action(() =>
{
DataUtil.CategoriesAndProducts[0].Products[0].Checked = true;
}), System.Windows.Threading.DispatcherPriority.Background, null);
Sincerely,
Krasimir
Developer Support Engineer
Infragistics, Inc.
www.infragistics.com/support
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?
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.