Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
100
Capture left mouse-click of Header
posted

Hi

I cannot currently capture the left mouse-click event on a header. What I would like to do is capture either the MouseDown or MouseLeftButtonDown event:

e.g.

<Style x:Key="HeaderStyle" TargetType="{x:Type igDP:LabelPresenter}">

<EventSetter Event="MouseLeftButtonDown" Handler="OnMouseLeftButtonDown" />

</Style>

then

grdMain.FieldLayouts[0].FieldSettings.LabelPresenterStyle = (Style)FindResource("HeaderStyle");

and

private void grdMain_MouseDown(object sender, MouseButtonEventArgs e)

{

... ... ... do something

}

This doesn't work for the left-click but it works fine for the right-click. I would imagine this is because the left-click event is already being captured and used to size / sort the columns. I would like to keep any sorting / resizing functionality but be able to additionally capture the left-click event and do something.

Any help much appreciated

Thanks

Jasdeep

Parents
No Data
Reply
  • 1336
    posted

    Hi Jasdeep,

     You should be able to use the PreviewMouseLeftButtonDown event to get this to work.

    Dave

Children
No Data