I have a Syncfusion datagrid control and I've included in it a CellRightTapped event and a FlyoutBase.ContextFlyout menu within the control. Now I'm having the CellRightTapped event code run only if column 3 is clicked.
So what I'm trying to figure out is how do I NOT have the context menu appear if column 3 is right-clicked.
Here is the XAML code that I have:
I would appreciate someone's help.
Thanks.

Ali BenchaabanPosted Sep 7, 2023, 8:52 AM
Hello Bob,
To achieve your goal, you can handle the
CellRightTappedevent and conditionally show the context menu based on the column index. Here's how you can do it in your XAML:In your code-behind, handle the
CellRightTappedevent and conditionally show the context menu based on the column index:In this code, we first obtain the column index of the right-clicked cell using
e.RowColumnIndex.ColumnIndex. If the column index is 2 (column 3), we sete.Handledtotrueto prevent the context menu from appearing. For other columns, we show the context menu usingContextMenu.ShowAt.This way, the context menu will only appear when you right-click cells in columns other than column 3.
Let me know if it works for you.
Regards,