ASP.NET TreeView and Selecting the Selected Node

后端 未结 9 1580
無奈伤痛
無奈伤痛 2020-12-14 11:02

How do I capture the event of the clicking the Selected Node of a TreeView? It doesn\'t fire the SelectedNodeChanged since the selection has obviously not c

9条回答
  •  一整个雨季
    2020-12-14 11:36

    Easiest way - if it doesn't interfere with the rest of your code - is to simply set the node as not selected in the SelectedNodeChanged method.

    protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e){
      // Do whatever you're doing
      TreeView1.SelectedNode.Selected = false;
    }
    

提交回复
热议问题