second click on treeview node with no selection change

I am working with TreeView in c#. I have an OnSelectedNodeChanged method.
When the user selects a node, it's caught and dealt with. But when the user selects the same node again, I can't catch it because I hadn't found a callback that deal with this.
Who is Participating?

Improve company productivity with a Business Account.Sign Up

Priest04Connect With a Mentor Commented:
Relegance, TreeView has a SelectedNodeChanged event. This event is fired when the different node is selected. So, in order to circumvent this, in the SelectedNodeChanged event we set curently selected Node's property Selected to false. Therefore, NO node is currently selected (at least this is what tree view thinks). So, after you click on the selected node AGAIN, it will check whether node that is clicked is selected, and since we set it as unselected, it will raise SelectedNodeChanged event again.

I dont understand what exactly you didnt understand. Or maybe I didnt? :)
As event name says, OnSelectedNodeChanged, it is fired when the selected node is changed. In your case, selection is not changing. Use Click event instead.

RelegenceAuthor Commented:
there is no such even for treeview..
i couldn't find any "onclick", "click", "onselect"..

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Ah sorry, its an ASP.NET treeview. Yes, you are correct there is no Click event. YTou could get away with this:

protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
    TreeView1.SelectedNode.Selected = false;

Open in new window

RelegenceAuthor Commented:
Except i am not changing a node, therefore it never gets there. that's actually my problem, because i do have one OnSelectedNodeChanged method working already.
Again - I need something to catch a Non selection-change-click. Just a click on the Same node.
In this case, postback is called, but how can i catch this event?
RelegenceAuthor Commented:
You are right, now i understand, i must have missed a part.
Then why did you give me B grade? What part of the question is left unanswered?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.