Class
TelerikContextMenu<TItem>

The class for the Telerik Context Menu component.

Definition

Namespace:Telerik.Blazor.Components

Assembly:Telerik.Blazor.dll

Type Parameters:

TItem

Syntax:

cs-api-definition
public class TelerikContextMenu<TItem> : HierarchicalBindingComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable, IMenuPopupContainer

Inheritance: objectComponentBaseBaseComponentBindingComponentBaseHierarchicalBindingComponentBaseTelerikContextMenu<TItem>

Implements: IComponentIDisposableIHandleAfterRenderIHandleEventIMenuPopupContainer

Inherited Members HierarchicalBindingComponentBase.IdFieldHierarchicalBindingComponentBase.ParentIdFieldHierarchicalBindingComponentBase.HasChildrenFieldHierarchicalBindingComponentBase.ItemsFieldBindingComponentBase.TextFieldBindingComponentBase.IconFieldBindingComponentBase.UrlFieldBaseComponent.ShouldRender()BaseComponent.OnInitializedAsync()BaseComponent.InitLocalizer()BaseComponent.ThrowIfParameterIsNull(object, string)BaseComponent.HaveOptionsChanged(IDictionary<string, object>, IDictionary<string, object>)BaseComponent.GetClassString(params string[])BaseComponent.InvokeAsync<T>(string, params object[])BaseComponent.InvokeAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidAsync(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidComponentMethodAsync(string, params object[])BaseComponent.InvokeComponentVoidMethodAsync(string, object)BaseComponent.InvokeDisposeAsync()BaseComponent.StateHasChanged()BaseComponent.RootComponentBaseComponent.ClassComponentBase.OnInitialized()ComponentBase.OnParametersSet()ComponentBase.OnParametersSetAsync()ComponentBase.OnAfterRender(bool)ComponentBase.InvokeAsync(Action)ComponentBase.InvokeAsync(Func<Task>)ComponentBase.SetParametersAsync(ParameterView)

Constructors

TelerikContextMenu()

Declaration

cs-api-definition
public TelerikContextMenu()

Properties

ContextMenuSettings

Specifies the component settings.

Declaration

cs-api-definition
[Parameter]
public RenderFragment ContextMenuSettings { get; set; }

Property Value

RenderFragment

Data

A collection that contains the ContextMenu items.

Declaration

cs-api-definition
[Parameter]
public IEnumerable<TItem> Data { get; set; }

Property Value

IEnumerable<TItem>

DisabledField

Defines the Disabled DataField of the DataSource.

Declaration

cs-api-definition
[Parameter]
public string DisabledField { get; set; }

Property Value

string

ItemTemplate

Defines the template for the items. The Item Template is defined under the ItemTemplate tag of the menu.

Declaration

cs-api-definition
[Parameter]
public RenderFragment<TItem> ItemTemplate { get; set; }

Property Value

RenderFragment<TItem>

OnClick

Defines the OnClick Event which is fired when clicking on a menu item.

Declaration

cs-api-definition
[Parameter]
public EventCallback<TItem> OnClick { get; set; }

Property Value

EventCallback<TItem>

OnItemRender

Fires when a ContextMenu item is being rendered. Can be used to provide custom styling for the ContextMenu's items.

Declaration

cs-api-definition
[Parameter]
public Action<MenuItemRenderEventArgs> OnItemRender { get; set; }

Property Value

Action<MenuItemRenderEventArgs>

Selector

Defines the selector for the target elements where the Context Menu will be shown. Uses CSS-type selectors.

Declaration

cs-api-definition
[Parameter]
public string Selector { get; set; }

Property Value

string

SeparatorField

Defines the Separator DataField of the DataSource.

Declaration

cs-api-definition
[Parameter]
public string SeparatorField { get; set; }

Property Value

string

Template

Defines the template for the whole context menu.

Declaration

cs-api-definition
[Parameter]
public RenderFragment<IEnumerable<TItem>> Template { get; set; }

Property Value

RenderFragment<IEnumerable<TItem>>

Methods

BuildRenderTree(RenderTreeBuilder)

Declaration

cs-api-definition
protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder

RenderTreeBuilder

Overrides ComponentBase.BuildRenderTree(RenderTreeBuilder)

Dispose()

Declaration

cs-api-definition
public override void Dispose()

Overrides BaseComponent.Dispose()

HideAsync()

Hides the context menu.

Declaration

cs-api-definition
public Task HideAsync()

Returns

Task

OnAfterRenderAsync(bool)

Declaration

cs-api-definition
protected override Task OnAfterRenderAsync(bool firstRender)

Parameters

firstRender

bool

Returns

Task

Overrides BaseComponent.OnAfterRenderAsync(bool)

Refresh()

Re-renders the component.

Declaration

cs-api-definition
public void Refresh()

ShowAsync(double, double)

Shows the context menu at defined coordinates.

Declaration

cs-api-definition
public Task ShowAsync(double clientX, double clientY)

Parameters

clientX

double

Coordinate for X axis.

clientY

double

Coordinate for Y axis.

Returns

Task