diff --git a/blazor/datagrid/context-menu.md b/blazor/datagrid/context-menu.md index 57c092dc48..fba9a5c27c 100644 --- a/blazor/datagrid/context-menu.md +++ b/blazor/datagrid/context-menu.md @@ -590,18 +590,24 @@ The **Copy** menu item is disabled for the **ShipCity** column and remains enabl Orders = OrderData.GetAllRecords(); } - private void OnContextMenuOpen(ContextMenuOpenEventArgs args) - { + private void OnContextMenuOpen(ContextMenuOpenEventArgs args) + { foreach (var item in args.ContextMenu.Items) { if (item.Text == "Copy" && args.Column.Field == nameof(OrderData.ShipCity)) { item.Disabled = true; } + else + { + item.Disabled = false; + + } } } } + {% endhighlight %} {% highlight c# tabtitle="OrderData.cs" %} @@ -651,7 +657,7 @@ public class OrderData {% endhighlight %} {% endtabs %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/rZrIiiZySUQfOieR?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} +{% previewsample "https://blazorplayground.syncfusion.com/embed/hNVdtihYpymYrjox?appbar=true&editor=true&result=true&errorlist=true&theme=bootstrap5" %} ## Show or hide context menu