Class SfContextMenu<TValue>
ContextMenu is a graphical user interface that appears on the user right click/touch hold operation.
Inheritance
Namespace: Syncfusion.Blazor.Navigations
Assembly: Syncfusion.Blazor.dll
Syntax
public class SfContextMenu<TValue> : SfMenuBase<TValue>, IMenu
Type Parameters
Name | Description |
---|---|
TValue |
Constructors
SfContextMenu()
Declaration
public SfContextMenu()
Properties
Filter
Specifies the filter selector for elements inside the target in that the context menu will be opened.
Declaration
public string Filter { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Target
Specifies target element selector in which the ContextMenu should be opened.
Declaration
public string Target { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder | __builder |
Close()
Closes the ContextMenu if it is opened.
Declaration
public void Close()
InsertAfter(List<TValue>, String, Boolean)
It is used to insert the menu items after the specified menu item text.
Declaration
public void InsertAfter(List<TValue> items, string text, bool isUniqueId = false)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<TValue> | items | Items that needs to be inserted. |
System.String | text | Text item before that the new Items will be inserted. |
System.Boolean | isUniqueId | Set true if it is a unique id. |
InsertBefore(List<TValue>, String, Boolean)
It is used to insert the menu items before the specified menu item text.
Declaration
public void InsertBefore(List<TValue> items, string text, bool isUniqueId = false)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<TValue> | items | Items that needs to be inserted. |
System.String | text | |
System.Boolean | isUniqueId |
OnAfterRenderAsync(Boolean)
Declaration
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | firstRender |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Overrides
OnInitializedAsync()
Declaration
protected override Task OnInitializedAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Overrides
OnParametersSetAsync()
Declaration
protected override Task OnParametersSetAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Overrides
Open(Nullable<Double>, Nullable<Double>)
This method is used to open the ContextMenu in specified position. If the positions are not specified, the context menu will open at its rendered position.
Declaration
public void Open(Nullable<double> clientX = null, Nullable<double> clientY = null)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Double> | clientX | Specifies the horizontal position of the context menu. |
System.Nullable<System.Double> | clientY | Specifies the vertical position of the context menu. |
RemoveItems(List<String>, Boolean)
It is used to remove the menu items from the Menu based on the items text.
Declaration
public void RemoveItems(List<string> items, bool isUniqueId = false)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<System.String> | items | Text items that needs to be removed. |
System.Boolean | isUniqueId | Set true if it is a unique id. |