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 and providing some code. Which version of Infragistics are you using?
Please clarify the purpose of UpdateActiveNode and why you are manually setting the IsSelected property based on the ActiveNode? When the end user clicks on a node it should become both active and selected automatically, without requiring the IsSelected property to be set. It's possible that the UpdateActiveNode method is happening more than once; thus selecting more than one node than desired.
In your UpdateActiveNode, you may want to check if the SelectedDataItems before and after setting the IsSelected property if you truly need to set it. Also, are you binding to SelectedDataItems? This might also be a factor to consider.
Note, without your complete design code of the DataTree I won't be able to provide you with a viable solution.
Let me know if you have any questions.
Michael DiFilippo said:Which version of Infragistics are you using?
I am using Infragistics v15.1. Is it possible that there is some issue in this version?
Michael DiFilippo said:Please clarify the purpose of UpdateActiveNode and why you are manually setting the IsSelected property based on the ActiveNode?
I use ObservableCollection and before adding new node I clear it. After it I must set active node.
Michael DiFilippo said:Also, are you binding to SelectedDataItems?
I do not.
Thank you for following up. I recommend updating a copy of your application to the latest version of Infragistics to see if the issue persists. However the issue is likely due to how you are activating nodes while new ones are added based on code and/or steps that I am not currently aware of. I appreciate you sending the code you have, however I am unable to completely decipher and provide you with a viable solution.
I think it's best if we have a remote session so I can see the behavior, replicate, and debug the issue so I can get a better understanding before I attempt to build my own sample that resembles your application.
Let me know if you this is possible and I will create a private support case for us.
If you have any questions please let me know.
Thank you. I will check newer version of Infragistics and let you know.
I checked Infragistics v18.1 and it works fine, problem does not occur. Is there a way to workaround this in older Infragistics (v15.1)?
I am not sure what exactly changed between 15.1 and 18.1. And without seeing the issue on my end I can't recommend making any changes other than to upgrade at this time. Note, 15.1 is also no longer maintained and supported. For more details, please visit our product lifecycle page.
Let me know if you have any questions.