ASP.NET TreeView and Selecting the Selected Node

asp.nettreeview

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 changed but then what event can I catch so I know that the Selected Node was clicked?

UPDATE:
When I have some time, I'm going to have to dive into the bowels of the TreeView control and dig out what and where it handles the click events and subclass the TreeView to expose a new event OnSelectedNodeClicked.

I'll probably do this over the Christmas holidays and I'll report back with the results.

UPDATE:
I have come up with a solution below that sub-classes the TreeView control.

Best Answer

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;
}
Related Topic