Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
314
CheckState change on node text click but not expand/collapse
posted

Hi!

I have an UltraTree with Override.NodeStyle = NodeStyle.CheckBox set.
I want to be able to change the CheckState for a node, not only by clicking the checkbox, but also by clicking the node's text (in order to make it easier for the user to select/deselect with less mouse precision). However I don't want the CheckState to be affected when clicking the expand/collapse part of the node.
I've tried working with different events but I can't figure out how to do this.
I would greatly appreciate any suggestions on how to solve this.

Thanks,
 -Ulf

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi Ulf,

    What you would have to do in a case like that is use the UIElements to determine what part of the node the mouse is currently over in the MouseUp or maybe MouseDown event. 

    If you haven't worked with UIElement like this before, I recommend that you get the Infragistics UIElementViewer Utility. It will be a big help in identifying the elements you need to check for.

    Basically, what you would do is call tree.UIElement.ElementFromPoint in the MouseUp event of the tree. That will return the element the mouse is currently over. You can then determine what you want to do to the node (if anything). Then you use the GetContext method on the UIElement to get the node and perform whatever operation you like.

Children
No Data