Hi Robert,
Thank you for contacting Syncfusion support
Query: It would be useful to have the ability to disable a DropDownButtonItem.
We have checked your reported query, you can achieve this by using beforeItemRender event. In this event you can add the “e-disabled” class for the specified item. Please find the below code snippet:
|
@using Syncfusion.EJ2.Blazor.SplitButtons
<EjsDropDownButton Content="Edit">
<DropDownButtonEvents OnItemRender="BeforeItemRender"></DropDownButtonEvents>
<DropDownButtonItems>
<DropDownButtonItem Text="Cut"></DropDownButtonItem>
<DropDownButtonItem Text="Copy"></DropDownButtonItem>
<DropDownButtonItem Text="Paste"></DropDownButtonItem>
</DropDownButtonItems>
</EjsDropDownButton>
@code {
private void BeforeItemRender(Syncfusion.EJ2.Blazor.SplitButtons.MenuEventArgs args)
{
if (args.Item.Text == "Cut")
{
args.Element.AddClass(new string[] { "e-disabled" });
}
}
} |
For your convenience we have prepared a sample. Please find the below sample link.
Please let us know if you need further assistance on this.
Regards,
Saranya D