Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Clicking on the expand icon

edited July 2019 in SRP Tree Control
Hi, when clicking on the expand button in the tree, two things happen in this order:

1. An OnClick event is generated
2. An OnItemExpand event is generated.

In the OnClick event, param1 contains the key of the node that belongs to the expand button.

Is there a way for me to know in the OnClick event that the OnClick event was generated by clicking on the expand button?
I need to know this, as clicking on the expand button and clicking on the node are two different use cases in my app.

I am using the latest version of the control.

Comments

  • If it's not possible, don't worry about it, as it's not a big deal. It would just be nice (;
    I do have a workaround as well.

    thanks
  • I've not tried this, but I wonder if you could use the Point argument that comes through the OnClick event and the GetItemRectEx method to determine if you are clicking on the expansion button.
  • Perhaps the ExpandBehavior property will assist you in your goals. If clicking on an item has it's own meaning, you should perhaps set this property to "None".
  • edited July 2019
    @DonBakke

    Good idea, I will try it.

    @KevinFourier
    Each node in the tree has products associated with it. When you click on a node, its products are loaded in the grid to the right of the tree. However, a node can have children. When expanding, i want to see the children of the node, not load the products of the node. So i don't think that ExpandBehaviour will work.

    Basically, I am trying to mimic the windows file browser. A directory has files (products), but it can also have sub-directories (children)


  • You are correct, but that's only because of the OnClick event. Try using the OnSelChange event instead for loading products. This is a better event anyway because it also fires if the use selects a different node using the keyboard.
  • hi, yeah i tried that, but we don't want the users to be able to select a node by navigating to it via the keyboard (as loading the products for a node can take a while, so we don't want to impede their ability to move through the tree with the keyboard)

    I will try don's idea. I think it will work.
Sign In or Register to comment.