|
-
Feb 3rd, 2007, 12:20 PM
#1
Thread Starter
New Member
Need help in treeview
Hello there......
I am using ASP.NET and C#.NET and want to perform action on right clicking on a node in treeview.I dont know even the event or property which might help me in perfoming this.How to perform action on right click?
I have searched a lot.....but i got the articals that tells about windows form and i want that in WEB FORM.
Please help me to solve this.
Thank you in Advance
Jigs
-
Feb 10th, 2007, 02:43 AM
#2
Frenzied Member
Re: Need help in treeview
Jigna:
I am not sure if this is what you are looking for or not.
The following example displays the ContextMenu assigned to
a TreeView when the right mouse button is clicked and released.
This code assumes you have a Form with a TreeView on it. It
is also assumed that the TreeView has a ContextMenu assigned
to its ContextMenu property.
[C#]
Code:
private void treeView1_MouseUp(object sender, MouseEventArgs e)
{
// If the right mouse button was clicked and released,
// display the context menu assigned to the TreeView.
if(e.Button == MouseButtons.Right)
{
treeView1.ContextMenu.Show(treeView1, new Point(e.X, e.Y) );
}
}
Also, I am not 100% certain, but I think that the mouse pointer must be over a child node and not a parent node.
Good Luck
-
Feb 10th, 2007, 09:09 AM
#3
Re: Need help in treeview
I'm guessing that AIS4U's code is for the WinForms TreeView, not the WebForms version.
-
Feb 10th, 2007, 09:02 PM
#4
Frenzied Member
Re: Need help in treeview
Yup, you are right.
didn't notice the Web forms part of the request.
sorry about that.
You can find the Web Forms TreeView Code here:
http://www.codeproject.com/aspnet/ExtendedTreeView.asp
Last edited by AIS4U; Feb 10th, 2007 at 09:25 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|