Detect Right Click in ColumnHeader

J

joannelai

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top