second click on treeview node with no selection change

Hi
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.
Thanks
Osnat
RelegenceAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
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? :)
0
 
Priest04Commented:
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.

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

0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Priest04Commented:
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

0
 
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?
0
 
RelegenceAuthor Commented:
You are right, now i understand, i must have missed a part.
Thanks
0
 
Priest04Commented:
Then why did you give me B grade? What part of the question is left unanswered?
0
All Courses

From novice to tech pro — start learning today.