Link to home
Start Free TrialLog in
Avatar of babybird
babybird

asked on

c# .net treeview... double click expanding vs executing further processing

Hi Experts!!

I have a treeview in a winforms c#.net app that I want to on double click expand to the child nodes if they exist, if they don't, it considers it the lowest level and calls a process to generate a report.

Right now I have it calling the process successfully but if it is not the lowest level node and they double click, it will call the process as well and that's not good.  So I need to add logic to identify if the selected node has children and if so, just expand to the next level. If not, call the further processing.

I'm not sure how to do that. Can you help me?
Avatar of NetworkArchitek
NetworkArchitek

So in your double click event, assuming the TreeEventArgs argument is called e, then do

if(e.Node.Nodes.Count == 0)
           runProcess();
ASKER CERTIFIED SOLUTION
Avatar of Dmitry G
Dmitry G
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial