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
300
XAMDataGrid - Header Click Event
posted

In XAMDataGrid..when User click on My Header i want to perfon some action.

e.g. I have Person Record. It has ID and Name which is bound to XAMDataGrid.

Now..when user click on Header ( ID ) ..I want to show dialog box where user wil enter value.

I cant' find a way to do this..

Plz help

thanks

BR

Parents
  • 9836
    Verified Answer
    posted

    You could either create a LabelPresenterStyle for the first Field (ID) and use EventSetter to handle the PreviewMouseLeftButtonDown or you can use the EventManager.RegisterClassHandler method to register default handler in codebehind. Note that this could probably disable the sorting on the Field.

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

    <EventSetter Event="PreviewMouseLeftButtonDown"

                        Handler="lp_PreviewMouseLeftButtonDown"/>

    </Style>

     

    void lp_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)

            {

                MessageBox.Show("LabelPresenter");

            }

    Let me know if you have any questions with this matter.

Reply Children
No Data