Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0 Treeview
Hi,
 
How to handle the nodemouceclick event and double click event of treeview when the mousedown has implemented.
 
Thank's in Advance.
Posted 25-Sep-11 23:21pm
Comments
Mehdi Gholam at 26-Sep-11 5:37am
   
Please specify, ASP.net, WinForms, WPF, which one?
BillWoodruff at 26-Sep-11 6:37am
   
As Mehdi comments, we need to know more here. These events do not occur at the same time, so what do you mean when you say: "handle ... at the same time" ?
Member 3827009 at 27-Sep-11 0:20am
   
Hi,
 
My requirement is need to drag&drop the Treeview from one side to anotherside.
In Node click We need to retrieve the particular node content through service method calling.
In Node Double click event we need to start playing that text in Speech voice through the service method call.
In this senarios I can able to handle Mouse Down and Node Mouse Click but double click is not getting fired.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hi BillWoodruff,
 
I have a treeview.I want to add node in selected node.My data is coming from SharePoint custom list.Custom list contains two content type folder.How can I achieve this.Can you provide me the solution.
  Permalink  
Comments
Sandeep Mewara at 12-Jul-12 12:23pm
   
This is not an answer. Please use 'Have a Question or Comment' link to respond to an answer. It will notify answerer of your comment such that he can come back and reply.
BillWoodruff at 13-Jul-12 0:04am
   
Hi Deempy, This is not an answer. You should submit this as a new question. Personally, I am not familiar with SharePoint or its "custom list." Try to give as much information in your question as you can. good luck, Bill
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You may not find these comments an "answer" to your question, but ... I think this is the only way I can be helpful to you, given the limited information you provide.
 
1. I suggest you create a new WinForms project, put a TreeView on it, and define handlers for the TreeView's:
 
BeforeSelect, AfterSelect, NodeMouseClick, NodeDoubleMouseClick, Click, DoubleClick, MouseDown, MouseClick, MouseDoubleClick Events.
 
In those handlers put a simple Console.WriteLine statement printing out the name of the Event. Like this:
private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
    Console.WriteLine("treeView1_NodeMouseClick");
}
And then, run the project four times with these actions on your part:
 
a. slowly mouse click on a TreeView Node and release the Mouse.
 
b. at a slightly faster rate, do several mouse clicks on the TreeView Node.
 
c. double-click on the TreeView Node, releasing the Mouse as fast as possible.
 
d. do a series of double-clicks on a TreeView Node as fast as possible.
 
After each "run" of the Project, examine the Output window, and consider what you observe.
 
2. In code where you have DragDrop implemented define similar Event handlers for ALL Events related to DragDrop, like ItemDrag. Run, start a drag but stop the drag before you move outside the boundaries of the TreeView, stop the program, examine the output. Repeat for each possible part of a DragDrop operation.
 
Why do I suggest you do this: because I believe you will observe behavior that will lead you to change your interaction-design as it is. Once you understand the fundamentals of run-time interaction between Controls and Mouse, and then the DragDrop Events, you will, I believe, be able to make wise choices in your implementation strategy.
 
good luck, Bill
  Permalink  
Comments
Sandeep Mewara at 12-Jul-12 12:22pm
   
Comment from a new member:
Hi BillWoodruff,

I have a treeview.I want to add node in selected node.My data is coming from SharePoint custom list.Custom list contains two content type folder.How can I achieve this.Can you provide me the solution.
BillWoodruff at 13-Jul-12 0:02am
   
This is not the appropriate place for a comment that has no relevance to the answer it comments on, and you are quoting another user's question without quotes and attributing it to the original author, which is quite confusing. Please see my response to Deempy's "answer" below, for an example of how to reply to an OT answer on a QA topic. best, Bill

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 471
1 Maciej Los 325
2 Yogesh Kumar Tyagi 304
3 OriginalGriff 298
4 Prakriti Goyal 200
0 OriginalGriff 6,367
1 Sergey Alexandrovich Kryukov 5,296
2 Maciej Los 3,384
3 Peter Leow 3,259
4 DamithSL 2,490


Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 12 Jul 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100