Detect Right Click in ColumnHeader

  • Thread starter Thread starter joannelai
  • Start date Start date
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
 
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
 
Back
Top