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
635
How to override default context menu in cell in edit mode?
posted

I have a custom context menu bound to the DataRecordPresenter:

EventManager.RegisterClassHandler(typeof(DataRecordPresenter),
                DataRecordPresenter.ContextMenuOpeningEvent, new ContextMenuEventHandler(DRPContext));

But I also need it to open when I right-click on a cell that is in edit mode. Currently, the default clipboard menu comes up. What type should I use to override this with my custom context menu?

Parents
No Data
Reply
  • 27093
    posted

    Hello,

     

    I have been looking into your issue and can suggest creating a style for the XamEditor that your cell uses since it is actually the editor which is embedded in the cell and which enters edit mode. This way you will affect both states with one setting. E.g. if you have a DateTime value you can set the Field’s EditorStyle setting to:

     

    <Style TargetType="{x:Type igEditors:XamDateTimeEditor}">

        <Setter Property="ContextMenu" >

            <Setter.Value >

                <ContextMenu >

                    <ContextMenu.Items>

                        <TextBlock Text="Item 1 "/>

                        <TextBlock Text="Item 2"/>

                    </ContextMenu.Items>

                </ContextMenu>

            </Setter.Value>

        </Setter>

    </Style>

     

    Hope this helps. Please let me know if you require any further assistance on the matter.

     

    Sincerely,

    Petar Monov

    Developer Support Engineer

    Infragistics Bulgaria

    www.infragistics.com/support

     

Children
No Data