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
1080
xamDataGrid context menu do not always pop up
posted

I'm using a xamDataGrid 10.3.  I've implemented a context menu for a DataRecordPresenter using the following XAML

            <igDP:XamDataGrid.Resources>
                <Style TargetType="{x:Type igDP:DataRecordPresenter}">
                    <EventSetter Event="ContextMenuOpening" Handler="DRPContextMenu"/>
                </Style>
            </igDP:XamDataGrid.Resources>

 

and the appropriate event handler

 

        void DRPContextMenu(object sender, ContextMenuEventArgs e)
        {
            DataRecordPresenter dp = sender as DataRecordPresenter;
            ContextMenu c = new ContextMenu();

            MenuItem itemFD = new MenuItem() { Header = "Layout: " + dp.Record.FieldLayout.ToString() };
            c.Items.Add(itemFD);

            MenuItem itemInfo = new MenuItem() { Header = "Record Index: " + dp.Record.Index };
            c.Items.Add(itemInfo);

            dp.ContextMenu = c;           
        }


The context menu is not displayed reliably, but quite often just a little square is displayed on the grid (see attached screen shot).

Any idea what this could be? How can I get rid of this little square and make context menus more reliable?

 

Markus