Hi, I have some issue during adding new node to XamDataTree with Shift key pressed. I use key modifier to execute another command (by Button.InputBindings). My add button have 2 different behaviours. Simple mouse click on add button, adds new node to the tree. After it new node is selected. Clik with Shift adds new node and opens it to edition in view on the right. It results in selecting all nodes that are under currently selected node (multiselection is enabled) - it is the problem. Any ideas why such strange behaviour occurs? How to resolve it? Best regards, Jacek
Hello Jacek, Thank you for contacting Infragistics. Did you set the XamDataTree's SelectionSettings.NodeSelection property to TreeSelectionType.Multiple? This will allow your end users to select multiple nodes via CTRL and SHIFT keys together as well as Mouse and Shift key together.
Do you require multiple node selection? From my understanding of your requirement you wish to have Click and SHIFT keys pressed together to open an additional view. However, if a single node is selected, then clicking the mouse on the same selected node without moving should reselect the same node. Every node underneath shouldn't be automatically selected unless you moved the mouse, clicked on another node and performed a range selection. eg. Multiple selection is only made when you click a starting node and hold shift, then click another node below.
You can revert to single node selection by setting TreeSelectionType.Single or None to disable selection.
Michael DiFilippo said:Did you set the XamDataTree's SelectionSettings.NodeSelection property to TreeSelectionType.Multiple?
Yes. It is set to multiple.
Michael DiFilippo said:Do you require multiple node selection?
Yes. I need multiple node selection.
Here are some screens presenting this behavior:
1. Clicking add button WITHOUT shift. New node (Call2) is selected but not opened for editing.
2. Clicking add button WITH shift. New node (Call4) is selected, opened for editing. But also all nodes underneath new node are also selected, however IsSelected (XamDataTreeNode.IsSelected) property is set for only new node.
Thank you for following up. Please provide a sample application that demonstrates the issue. Otherwise please provide all relevant code from the XamDataTree etc.
From the screenshots it appears your second screenshot is different, in that it doesn't have an "add" button.
Let me know if you have any questions.
Michael DiFilippo said:Please provide a sample application that demonstrates the issue. Otherwise please provide all relevant code from the XamDataTree etc.
I cannot provide code. It is big application and cannot separate some part of code that will work.
Could you please suggest how to find the root cause? Where to put break point? How to find event that cause selecting other nodes? I have debug it, put break point in all places that XamDataTreeNode.IsSelected is set to true and see that only for one selected by me node it is set.
When I put break point on XamDataTree.SelectedNodesCollectionChanged I see that there are multiple nodes (NodeSelectionEventArgs.CurrentSelectedNodes .Count > 1 and also NodeSelectionEventArgs.CurrentSelectedNodes.ShiftSelectedItems.Count > 1).
Michael DiFilippo said:From the screenshots it appears your second screenshot is different, in that it doesn't have an "add" button.
Second screenshot is edition view for selected node but is does not matter.