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
990
Field Finder on Mouse right click.
posted

Hi I am Unable find the "Field/UnBoundField" object on Right Click of Label/FieldHeader.?

I tried with Paranet, tempalted Parent , VisualTreeHealper.. but didnt helped.

Could you please give me a hint or example how can I Achive it..

Parents
No Data
Reply
  • 28407
    posted

    HI,

     Create a style targeting the LabelPresenter and wire up the PreviewMouseRightButtonDown Event.


    <Style TargetType="{x:Type igDP:LabelPresenter}">
                    <EventSetter Event="PreviewMouseRightButtonDown" Handler="xgrid1_PreviewMouseRightButtonDown"/>
                </Style>

     
    Then in this event, cast the sender parameter to a LabelPresenter and the Field property is now available for your use.


      private void xgrid1_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
            {
                LabelPresenter lp = sender as LabelPresenter;
                MessageBox.Show(lp.Field.Name);
            }

    Sincerely,
    Matt
    Developer Support Engineer

Children