473,790 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

diff. context menu for root and children

153 New Member
I have got one tree tree view control.I have three levels in it.
Example-

Root1
------->child1
------->child2
---------------->child1
---------------->child2
------->child3
Root2
------->child1

How would i have a diff context menu for dif levels ?
I mean if i click the roots i should have one context menu and when the chldren a diff context menu and when child of child a diff context menu.
Tha's because the meaning of diff types(based on level) is diff.

Thanks
Akshay
Jan 4 '09 #1
2 1951
nukefusion
221 Recognized Expert New Member
The TreeNode object has a ContextMenu and ContextMenuStri p property that can be used for setting the context menu for the individual node. The context menu can be different for each node if that's what you need, just set it when you create the nodes.
Jan 5 '09 #2
akshaycjoshi
153 New Member
well i did this
private void treeexchange_No deMouseClick(ob ject sender, TreeNodeMouseCl ickEventArgs e)
{
if (e.Button == MouseButtons.Ri ght)
{
treeexchange.Se lectedNode = e.Node;
this.Text=e.Loc ation.ToString( );

if(e.Node.Paren t==null)
{
if (e.Node.Text == "Extensions ")
cmsextensions.S how(treeexchang e,e.Location );
else if (e.Node.Text == "Trunks")
cmstrunks.Show( treeexchange, e.Location);
else
cmspbx.Show(tre eexchange, e.Location);
}

else if (e.Node.Parent != null && e.Node.Parent.P arent == null)
{
if (e.Node.Parent. Text == "Extensions ")
cmsgroups.Show( treeexchange, e.Location);
else
cmstrunk.Show(t reeexchange, e.Location);
}
else
cmsextension.Sh ow(treeexchange , e.Location);
}


I created diff CMS for each level's nodes.
There are only three levels so it worked.
Definitely not the best but was ok for me.
Jan 6 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
5987
by: Josh | last post by:
Caution, newbie approaching... I'm trying to come up with a very simple Tkinter test application that consists of a window with a drop-down menu bar at the top and a grid of colored rectangles filling the remainder of the window. Mind you, this is a contrived test application to help me understand Tkinter and Python, not an actual application yet. I've trivially subclassed Tkinter.Canvas into ColorCanvas, added a bunch of ColorCanvases...
7
3000
by: johkar | last post by:
I am confused on childNodes or children. When you have nested lists, I would think it would all be one list in the Dom, this doesn't seem to be the case. So how do you traverse an unordered list? Any help appreciated. John In the below script, I can expand and contract the nodes when clicked on, but I want the menu to close all other siblings to the node clicked so that only one sub menu option is expanded at one time. If the node...
4
4957
by: Andreas Kasparek | last post by:
Hola! I'm preparing my master thesis about a XML Merge Tool implementation and was wondering if there is any open standard for XML diff regarding topics like: - is a diff result computed on the ordered or unordered xml node tree of the compared documents? - what identifiers/criteria should be used by default to match elements of the same type in different documents? - should a diff tool consider move operations or only insert/delete
2
3755
by: Claire | last post by:
I've a treeview control containing a root node with several children on a windows form. I select a node with a left mouse button click. I then select one of the other nodes with right mouse click to bring up my context menu. The Popup event of this enables menu items depending on the node selected. The new node highlights, and my context menu pops up but I noticed that the enabled state of the menu items was incorrect. Tracing into my...
6
6167
by: Travis | last post by:
Is there a community accepted best way to store a menu tree for an interface in a data structure. Ideally I would like something that searches fast so given a menu structure like this File / | \ / | \ Print Exit Edit / \ Copy Paste
0
1427
by: sloan | last post by:
http://weblogs.asp.net/scottgu/archive/2006/01/17/435765.aspx http://aspnet.4guysfromrolla.com/articles/030806-1.aspx I've been looking for an implementation of a Menu Control that controls "drill down" on the non selected item. For Example, if my menu system looked like this -Home
2
2273
by: parez | last post by:
Hi, I build the menu strip using the designer.I want the context menu of the form to be same as the of children of one of the top leven Menu strip item. Items gives me a ToolStripItem object but it does not have a hierarchy, no parents no children.
0
992
Fuhrer
by: Fuhrer | last post by:
Hi all, I have some problems concerning ASP.NET 2.0 Menu in my new web application(With C# code). I have my menu items saved into an SQL Server 2005 table, and i have in my application an xml datasource related to the menu. I retrieve my data and save them into this xml datasource. The menu is generated with no problems. But in each of my root items(staticMenuItems) i have a picture then the description of the item. My first problem...
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9512
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10413
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10145
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9021
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4094
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3707
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.