473,787 Members | 2,931 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with right click in treeview(URGENT )

35 New Member
hi,
I have a treeview when rightclicked a context menu should appear. but first time wen i right click the context menu of that node(ie, add,delete) appears whereas when i right click another node the context menu of the previously selected node appears.ie, context menu with add, delete appears instead of add,delete and edit.can anyone help in this issue. Here is my code.
if(e.Button==Mo useButtons.Righ t)
{
treeView1.Selec tedNode = this.treeView1. GetNodeAt(e.X, e.Y);
//MessageBox.Show (this.treeView1 .SelectedNode.T ext);
Point clickPoint = new Point( e.X,e.Y );
TreeNode clickNode = treeView1.GetNo deAt( clickPoint );
if ( clickNode == null ) return;
else
{
treeView1.Selec tedNode = clickNode;
// Convert from Tree coordinates to Screen coordinates
Point screenPoint = treeView1.Point ToScreen( clickPoint );

// Convert from Screen coordinates to Form coordinates
Point formPoint = PointToClient( screenPoint );

if(treeView1.Se lectedNode.Text =="collection ")
{
treeView1.Conte xtMenu= popUpMenu;
treeView1.Conte xtMenu.Show(thi s,formPoint);
}
else if(treeView1.Se lectedNode.Text =="TestCase")
{
treeView1.Conte xtMenu=TreeMenu ;
treeView1.Conte xtMenu.Show(thi s,formPoint);
}
}
}
Jan 25 '07 #1
3 1448
kenobewan
4,871 Recognized Expert Specialist
Here is an example that may help:
The ASP.NET 2.0 TreeView Control
Jan 25 '07 #2
sugee
35 New Member
thanks for ur reply....but i need it in c#.net
Jan 25 '07 #3
sugee
35 New Member
i think theres some problem in showing the context menu...the node gets selected correctly...but the correct context menu doesnt appear.can u reply me soon?
Jan 25 '07 #4

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

Similar topics

10
2333
by: riki | last post by:
Hi, i have a big problem...i'm using one jscript for resizing of all of my pics in popUp...in main html i'm having many little pics and clicking on them they open in popUp and resize to larger version of the same pic. now, it works fine and sometimes when i click on little one it doesn't resize well... this is the code: main.html
4
2778
by: Sachin Jagtap | last post by:
Hi, I am getting exception while poping item from queue, I am writing messages coming from client in a queue in one thread and then in other thread i am reading from queue and writing in file. I have not implemented any syncronization between reading and wrinting, just i checking size of queue, if it is not empty i am reading from queue and wrting to file. somethign like
2
9977
by: WantedToBeDBA | last post by:
Hi all, We have db2 installed on AIX box (db2 version - 8.1). Its started and i am able to view 50000(default port) in netstat(netstat -a -n). But when i try to connect using telnet, i am getting this error. I don't know how to correct it. Till yesterday its working well. I don't know what is the problem now.. Help me guys. Its very urgent
5
1372
by: Ugrasena via DBMonster.com | last post by:
Hi team we have DB2 7.2 Server on Win 2000 mechine. I am getting a dialog box on the Server db2 db2syscs.exe - Application Error The Instruction at "0x6c8008ea" referenced memory at "00720b3807". The memory could not be "read". Click on OK to terminate the program
3
1358
by: Bill Nguyen | last post by:
I found that rows in datagrid can be sorted by clicking on the column header. However, this doesn't refresh the .currentindex DataGrid1.CurrentCell.RowNumber I need either to disable colum sorting programmatcially or somehow refresh the DataGrid1.CurrentCell.RowNumber index so that it will reflect the correct rownumber.
10
2367
by: lakshmananl | last post by:
hi, i have a problem in importing data from .ixf files the dump was got from AIX box and this dump is to be imported to win2003 box with db2v7.2 fixpack8. i have just created a new db in the win2003 and this dump is to be imported to the new db. IS the db2look.sql necessary for doing this???or is there any other method of doing this. kindly help me in this issue. thanks lakshmanan
1
1200
by: Werner | last post by:
#1 Today 08:18 AM Public AtendanceName() As String 'Array to store names Public ix As Integer Public i As Integer
1
1235
by: Hemant Pathak | last post by:
Hi All i have develop a software(Customer Service Managment System) front end is VB 6.0 and Back end is SQL 2000 i want to run this software is Server System and Client System the how can i do this. please urgent...........
2
1214
by: ruchikagupta | last post by:
i have a grid view with two select command buttons and i want to track which one is clicked how can i do tht can any1 plz help its really urgent
0
9655
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
10172
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
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
9964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6749
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
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4069
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
3670
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.