Hi,
We are using XAMDataTree. and Hierarchy is Parent Node and then Child Node. If we Select Child Node then we are trying to get selected Child Node value along with its parent Node Value. Right now We are only to get Parent Node Value not able to get selected Child Node value and Its Parent Node Value.
Please let us aware. Your help will be appreciate.
Thanks
Hello Piyu,
XamDataTree node could be selected dynamically in code based on some custom logic by setting the XamDataTreeNode.IsSelected property to true. This could be achieved by handling the SelectedNodesCollectionChanged event and applying the logic there:private void tree1_SelectedNodesCollectionChanged(object sender, Infragistics.Controls.Menus.NodeSelectionEventArgs e) { if (e.CurrentSelectedNodes.Count > e.OriginalSelectedNodes.Count) { XamDataTreeNode newSelectedNode = e.CurrentSelectedNodes[e.CurrentSelectedNodes.Count - 1] as XamDataTreeNode; if ( newSelectedNode != null ) { if (newSelectedNode.Manager.ParentNode != null && !newSelectedNode.Manager.ParentNode.IsSelected) { XamDataTreeNode parentNode = newSelectedNode.Manager.ParentNode; parentNode.IsSelected = true; } } } }Please note that by default a single selection is enabled for the tree. The multiple selection should be allowed to have both the child and the parent selected:<ig:XamDataTree.SelectionSettings><ig:TreeSelectionSettings NodeSelection="Multiple"/></ig:XamDataTree.SelectionSettings>I am attaching a sample application that illustrates this behavior. If you have any questions on the same, do not hesitate to let me know.
Hello,
Thanks for your support but here we are using mouse double click event and as we double click on any node either child sub child or parent then on double click event we are trying to get the selected node value as well as its parent node values.
private void LocationDataTree_MouseDoubleClick(object sender, MouseButtonEventArgs e) { Infragistics.Controls.Menus.XamDataTreeNodesCollection NodeCollection = LocationDataTree.Nodes; object [] selectItem = LocationDataTree.SelectedDataItems;
}
But using above code we can get only selected Parent Node value. if we select child Node in this case selected item is showing null.
Please guide us.
Thanks.