473,804 Members | 2,201 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Detect Right Click in ColumnHeader

Hi all,

In my project I have a ListView and a ColumnClick event is added to
sort the clicked column. I want to have a Context Menu when the
ColumnHeader is right clicked, but I find no way to detect the right
click of ColumnHeader.

I wonder if someone can give me some hints or suggestions. Thanks
:)

Joanne
Nov 16 '05 #1
1 2408
Hi,

You can do it in the "MouseDown" event handler by the DataGrid's
(Windows) method: HitTestInfo HitTest(int x, int y)
-remember to check right mouse button

HitTestInfo should provide any wanted information for you.

Regards

Marcin
Hi all,

In my project I have a ListView and a ColumnClick event is added to
sort the clicked column. I want to have a Context Menu when the
ColumnHeader is right clicked, but I find no way to detect the right
click of ColumnHeader.

I wonder if someone can give me some hints or suggestions. Thanks
:)

Joanne

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
10367
by: DJ WIce | last post by:
Hi, I'm looking for a script to get the hi-est z-index on a page. I want my javascript menu to be always on top of the page (moves along on top when you scroll down). Does anyone know how to scann all items/elements on the page for a z-index? Thanks, Wouter
19
6815
by: lihua | last post by:
Hi, Group! I got one question here: We all know that fclose() must be called after file operations to avoid unexpected errors.But there are really cases when you forget to do that!Just like what happens in memory operations, everyone knows the importance of freeing the allocated memory, but there do have memory leaks from time to
4
5602
by: Alan Seunarayan | last post by:
Hello, I have a number of ColumnHeaders that are 'hidden' (width set to zero). However, it is still possible to size them. The reason why they are hidden is to give the illusion that they do not exist. Is there a way to stop the user from being able to resize column headers that I have set their width to zero? Many thanks,
0
1618
by: Shravan | last post by:
Hi, I saw that in Windows Forms DataGrid with new row creation set to true, if I have added a new row earlier which was empty and deleted the row and shifted the focus to any other control and then clicking on the column header of the grid is making the grid to go to edit mode which is causing the first row to be ready for allowing user input. Does anybody of you know how to stop this behaviour, i.e., new row should not be put into edit...
1
4973
by: Lalit Bhatia | last post by:
Hi when focus is on a cell in datagrid. double click event does not occur. when I double click on rowheader, columnheader then this event fires. I am using DataGridTableStyle in the grid. -- Regards, Lalit Bhatia
1
1445
by: Manny Chohan | last post by:
hi Guys, i want to implement the double click functionality in datagrid. I am using c#. can some one recomend a good article whihc shows you how to do it. Thanks Manny
10
4297
by: babis | last post by:
I work with .NET2003 C# windows form application, i add a datagrid in my form like this: dataGridProduct.DataSource = dataViewProduct; I also make the allowSort property of the datagrid set to be true. Here is my problem, i want to make when i click one of the datagrid cell, said there're ProductID or ProductName, i also show it in my textBoxProductID or textBoxProductName. If i don't have sorting, and i click in the datagrid cell, i...
3
5969
by: rchak2k | last post by:
Hi! I have to capture the event of mouse right click menu selection. e.g. I need to capture the event if someone click the "close X" option displayed at the bottom of the right click menu. Any idea?? thanks!!
3
2420
by: =?Utf-8?B?WVhR?= | last post by:
I have set the names of each column on design-time, but the code below could not get their names, why? thank you. //////////////////////////////////////////////////////////////////////// For Each EachColumnHeader As ColumnHeader In ListView1.Columns MessageBox.Show(EachColumnHeader.Name) Next
0
10595
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...
0
10088
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...
0
9169
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...
1
7633
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
6862
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
5529
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...
0
5668
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4306
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
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.