Hi,
We are using XAM Data tree for Parent Child node. we have add check Box also. But when I add Item source, Field Name not showing in Parent Node. We are binding source in View Model.
In Item source I have Bind Observable collection "Menu" and fetch list of items from data base. But Nothing showing in parent Node and its child Node.
<ig:XamDataTree x:Name="MyTree" ItemsSource="{Binding Menu}" DisplayMemberPath="Menu Name"> <!-- Enable Check Boxes--> <ig:XamDataTree.CheckBoxSettings> <ig:CheckBoxSettings CheckBoxVisibility="Visible"/> </ig:XamDataTree.CheckBoxSettings> <ig:XamDataTree.GlobalNodeLayouts> <ig:NodeLayout Key="Menu_ID" TargetTypeName="Menu_ID" DisplayMemberPath="Menu_ID"/> <ig:NodeLayout Key="Menu_Name" TargetTypeName="Menu Name" DisplayMemberPath="Menu_Name"> <!-- Disable Check Boxes at the Product Level --> <ig:NodeLayout.CheckBoxSettings> <ig:CheckBoxSettingsOverride CheckBoxVisibility="Collapsed"/> </ig:NodeLayout.CheckBoxSettings> </ig:NodeLayout> </ig:XamDataTree.GlobalNodeLayouts> </ig:XamDataTree>
Thanks
Hi Pri,
Thank you for your post. I am attaching a sample application(DataTree_VM.zip) where I am showing how to bind the XamDataTree to your view model.
Let me know, if you need any further assistance on this matter.
Thanks for such a great help. Now one thing more which i want to discuss about multiple selection of parent and child node. I am using checkbox in parent and child node. Now how I collect selected Parent and child node using MVVM.
Any help would be a very appreciate.
Thank you for your reply. In order to bind the selected items from the XamDataTree to your view model, you need to define a new property in your view model, which type is array of obejcts.
I am attaching a modified version of my sample application(DataTree_VM_2.zip) in order to demonstrate it.
Thanks for that. But SelectedDataItems property giving null data, We have set this property in view Model, but not getting selected data items its giving null value.
Is there any missing, Please let us aware about that.
Hello Pri,
You can see how exactly I have implement the same in my sample application because everything works correctly there.
I believe that you are missing something.
I have checked but still I am getting null value. Is there any way to select multiple Items.
<ig:XamDataTree x:Name="ScreenTree" ItemsSource="{Binding Path=ScreenMenu}" SelectedDataItems="{Binding Path=SelectedScrrenItems}" Grid.Column="4" Grid.RowSpan="6" Grid.Row="1" NodeLineVisibility="Visible" IsExpandedMemberPath="IsExpanded"> <!-- Enable Check Boxes--> <ig:XamDataTree.CheckBoxSettings> <ig:CheckBoxSettings CheckBoxVisibility="Visible" /> </ig:XamDataTree.CheckBoxSettings> <ig:XamDataTree.SelectionSettings> <ig:TreeSelectionSettings NodeSelection="Multiple"/> </ig:XamDataTree.SelectionSettings> <ig:XamDataTree.GlobalNodeLayouts> <ig:NodeLayout Key="Children" TargetTypeName="GroupMenuModel" DisplayMemberPath="Menu_Name"/> </ig:XamDataTree.GlobalNodeLayouts> </ig:XamDataTree>
Is there any mistake than please suggest us.
I am just checking if you require any further assistance on the matter.