Does "TreeNode.Expand()" trigger "BeforeExpand" event RRS feed

  • Question

  • In other words, if I have "treeNode1.Expand()" in my code, will my BeforeExpand event handler be called before my Expand call returns? Also, will setting a TreeNode's Selected property trigger the AfterSelect event?

    I ask because in some other programming systems changing something programmatically does not always trigger relevant events.

    Wednesday, July 25, 2007 8:13 PM


  • The answer is no. You have to call the BeforeExpand handler yourself before the call to treenode1.Expand(); but, setting TreeView.SelectedNode to the node you want to select will trigger the AfterSelect event. Go figure.
    Thursday, July 26, 2007 6:38 PM