Hi,
How can I make the checkbox visible on selective nodes of UltraTree?Also, can I make checkbox disabled selectively?
Thanks in advance.
Hello ,
You could disable particular node if you set its Enabled property to false, this also will disable expand indicator. Regarding removing of expand indicator you could do this trough IUIElementCreationFilter interface. More information about this interface you will find on the following link:
http://help.infragistics.com/NetAdvantage/WinForms/2012.2/CLR4.0/?page=Win_Creation_Filter.html
Also I have created a very base sample in order to demonstrate you this approach.
Please let me know if you have any further questions.
Hi Hristo,
I am not looking for disabling/hiding expand indicator, instead I was referring about checkboxes which can be enabled on ultratree as mentioned on the following link -
http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.2/CLR2.0/html/Infragistics2.Win.UltraWinTree.v11.2~Infragistics.Win.UltraWinTree.Override~NodeStyle.html
Can these checkboxes be selectively disabled/hidden?
Thanks.
Hello,
You could display checkbox on particular node when you manage its NodeStyle, for example if you want to display cheek box to second node of your tree you should use code like:
ultraTree1.Nodes[1].Override.NodeStyle = NodeStyle.CheckBox;
In order to disable checkbox you should handle BeforeCheck event and to cancel it, and also should use Creation filter in order to make checkbox to appear as disabled. Please see attached sample.
Thanks Hristo,
What you suggested is exactly what i needed.
I have one more question on the same -
In the above image, nodes A, B and G are currently selected/checked. if I select node E, node G gets deselected. As I understand, the radio buttons are grouped based on the level on which they exist. Since nodes E and G are on the same level, only one of them can be selected at any time.
Now my question is, can I change this behavior "anyhow", to select nodes based on the hierarchy? I need nodes A and B to get deselected if any of nodes E or G are selected since nodes A and B are parents of nodes E and G; also, selecting nodes E and G together should be possible as they don't fall in same hierarchy.
Please suggest.
As far as I understand you want customer to be able to select single option from all nodes of every level . In this case you should iterate trough all nodes of UltraTree when any node is checked, in order to uncheck the rest. I have implement my suggestion in a simple sample. I hope that this will helps you.
Please let me know if you have any further questions .
Thanks Hristo, that did answer my query.
One more question I have.For checkboxes on the tree, is it possible to have the parent nodes display partial checked state in case some of the child nodes are checked and complete checked state when all the child nodes get selected.
HOWTO:How do I automatically set a parent node's checked state based on whether none/some/all of its child nodes are checked?