Hi,
I have a requirement in which I need to enable user to select multiple nodes using ctrl key on the tree based on a criteria (node type). Overriding the SelectionType = Extended and SelectionBeavior = ExtendedAcrossCollections would enable me to select nodes of any type.
If my tree is modelled like below, I want to enable Ctrl+Selection only on nodes B1, B2, B3 and D1, D2, D3. Anywhere else the Ctrl+selection should function as select single node. Let me know if this behavior can be achieved?
A (root)
B(child)
B1, B2, B3 (children of B)
C (Child)
C1, C2, C3
D (Child)
D1, D2, D3
Oh, sorry. It wasn't clear to me that that wasn't working.
There's no way to do that with just properties settings. Once you turn on SelectionBehavior.ExtendedAcrossCollections, it's going to ignore the setting on the Override.
For more complex selection validation like you want, you will have to write code. What you can do is handle the BeforeSelect event, examine the NewSelections, and if it violates what you want to allow, you just set e.Cancel to true.
Mike,
I did try the sample attached by Hristo with my 10.3 version of infragistics, the sample doesn't allow me to select one node of B (say B1) and another node of D (D3). Can we allow cross node multi selection (between B1 + D3) by overriding at node levels?
Let me know if this is supported or any work around for the same. Am using 10.3 version of Infragistics, Let me know if I need to upgrade to v12 to support this.
Thanks,
Chandrakant.
You may not have noticed it, but Hristo attached a sample project to his post which does exactly what you asked for. Did you try the sample?
Basically, you can control the selection at any level of the tree - anywhere there is an Override. So in the sample, the tree is single-select, but Nodes "B" and "D" are set to allow multi-select.
This is perfect sample doing half of my requirement. Can you please let me know if I can select nodes across collections? I want to have multi-select across B & D too, i.e B1 and D1 to be selected.
I tried UltraTree.SelectionBehavior to be extended across collection, but that seems to select multiple nodes of "C". Let me know if I can try anything else?
Hello ,
Nodes collection of Node object has Override property, which you could adjust in order to manage selection type of this collection. For example you could set
ultraTree1.GetNodeByKey("B").Nodes.Override.SelectionType = Infragistics.Win.UltraWinTree.SelectType.Extended;
And then child nodes of B node will be multiselected. Please see attached sample.
Please let me know if you have any further questions.