CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2008
    Posts
    66

    TreeNode beforeExpand Operation

    Hi all!

    I would like to dynamically populate my tree. In order to do that, I would like to use the event beforeExpand.

    When the user clicks on the node plus signal, I would like that my app requests some information, and so, it will add some children to the expanded node.

    The problem is that I don't know how can I get the expanded node. How do I do it?

    Thank you!

  2. #2
    Join Date
    Apr 2002
    Location
    Egypt
    Posts
    2,210

    Re: TreeNode beforeExpand Operation

    In the event handler, use e.Node.
    e is the TreeViewCancelEventArgs parameter passed to the event handler.
    Hesham A. Amin
    My blog , Articles


    <a rel=https://twitter.com/HeshamAmin" border="0" /> @HeshamAmin

  3. #3
    Join Date
    Mar 2004
    Location
    Prague, Czech Republic, EU
    Posts
    1,701

    Re: TreeNode beforeExpand Operation

    What kind of tree control do you use? If it is the VS native one, than the BeforeExpand event has an argument of TreeViewCancelEventArgs type, which contains Node property. This Node is the node you are interested in.
    • Make it run.
    • Make it right.
    • Make it fast.

    Don't hesitate to rate my post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured