How to customize the context menu?

Posted by: info on 10 May 2022, 11:31 pm EST

    • Post Options:
    • Link

    Posted 10 May 2022, 11:31 pm EST

    Hello.

    C1.WPF.Grid.Ja 6.0.20221.218

    How to customize the context menu on the FlexGrid?

    Sometimes a default context menu is also displayed.

    
    <c1:FlexGrid ItemsSource="{Binding List}">
        <c1:FlexGrid.ContextMenu>
            <ContextMenu>
                <MenuItem Header="AAAAAAAAAA" />
            </ContextMenu>
        </c1:FlexGrid.ContextMenu>
    </c1:FlexGrid>
    ```[img]https://gccontent.blob.core.windows.net/forum-uploads/file-f3f35650-fd24-4b66-a63a-af2ac944240b.png[/img][img]https://gccontent.blob.core.windows.net/forum-uploads/file-147930f8-b057-4bab-9939-569d86b62c12.png[/img]
  • Posted 11 May 2022, 3:36 pm EST

    Hi,

    Thanks for the snapshot.

    We have replicated this behavior at our end. This seems like a bug. So, that we have escalated it to the development team. We will get back to you once we have any update from them. [Internal Track Id - C1XAML-29447]

    As a workaround, you can disable the default context menu popup by handling PreviewMouseRightButtonDown event of Flexgrid as:(See code snippet)

    
    private void Grid_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
    {
          e.Handled = true;
    }
    
    

    Please refer the attached sample for the same:FlexContexMenuDemo.zip

    Best Regards,

    Nitin.

  • Posted 11 May 2022, 11:32 pm EST

    Thank you. It works. I will wait for the fix.

  • Posted 25 April 2023, 4:34 pm EST

    Hi,

    As per the development team, this is not a bug. You can disable the default menu by setting FlexGrid.ShowSelectionMenu property to false.

    Regards,

    Nitin

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels