cancel
Showing results for 
Search instead for 
Did you mean: 

Multiselection in Tree control

Former Member
0 Kudos

Is there a way to mutiselect nodes in a Tree control?

Carmit.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Out of the box -- no.

You can emulate such functionality:

1. Add boolean attribute IsSelected and calculated string attribute Icon to node. Icon returns checked / unchecked image url depending on value of IsSelcted attribute.

2. Bind ImageUrl property of TreeNodeTreeItem to Icon attribute.

3. In TreeNode / TreeItem onAction handler toggle value of IsSelected attribute

Regards,

VS

Former Member
0 Kudos

Hi Valery,

The solution you suggest gives a way to identify selected nodes by changing their icons, but I'm talking about the possibility to MARK two (or more) nodes, like you can do in Tables.

Carmit.

Former Member
0 Kudos

Read the latest item of my previous post:

Assign onAction event handler for corresponding Tree UI controls, and toggle IsSelected attribute of underlying node element. This is not the most elegant way, but the only possible so far

VS

Former Member
0 Kudos

I understood what you said, and still, the user will not see two selected (marked in blue) nodes, but will see two nodes which their icons may indicate they are selected, but only one node will be marked in blue. Is this correct?

Former Member
0 Kudos

Yep, you understand me absolutly correctly. Morevover, if user clicks on node (and it is always the case with existing L&F when user use mouse rather then keyboard) it ALWAYS lead to toggling selection. Quite annoying. Therefore I said that this solution is not perfect.

VS

Former Member
0 Kudos

Thanks, Carmit.

former_member374
Active Contributor
0 Kudos

Hi Carmit,

You are thanking a poster for his answer.

Please next time also give him points.

See: /people/mark.finnern/blog/2004/08/10/spread-the-love

This time I did it for you.

Remember: When you ask a question you also assume the responsibility to assign points.

Please check your other questions and if the answers were good. Spread the love and give some points.

Thanks in advance, Mark.

Answers (0)