radzenhq / radzen-blazor

Radzen Blazor is a set of 90+ free native Blazor UI components packed with DataGrid, Scheduler, Charts and robust theming including Material design and FluentUI.
https://www.radzen.com
MIT License
3.57k stars 798 forks source link

ContextMenuItem - Add separator item type #1201

Closed RemiCELLARD closed 1 year ago

RemiCELLARD commented 1 year ago

Is your feature request related to a problem? Please describe. I'm always frustrated when you have to use RenderFragment instead of ContextMenuItem class to create a separator in ContextMenu (example : for DataGrid Cell)

Describe the solution you'd like

Describe alternatives you've considered You can use RenderFragment (see https://blazor.radzen.com/docs/api/Radzen.ContextMenuOptions.html#Radzen_ContextMenuOptions_ChildContent ) but for my case, it's better to use object.

Additional context No more element

enchev commented 1 year ago

You can already place any custom content for the context menu including RadzenMenuItem and a plain hr HTML element: image image https://blazor.radzen.com/contextmenu

dave-gcv commented 3 months ago

Trying to understand why this was closed/not considered ?

Like the OP, I am also looking for an "easy" programatic way to add a separator to the context menu.

Having to use the RenderFragment way just isn't convenient enough, is prone to error and inefficient especially if you have a large number of items in the menu or the items that appear in the menu are dynamic based on various factors.

Having the "IsSeparator" flag or even support for Class property (applied to the li element) just seems logical ?