Class
TelerikContextMenu<TItem>

The class for the Telerik Context Menu component. Children: ContextMenuSettings.

Definition

Namespace:Telerik.Blazor.Components

Assembly:Telerik.Blazor.dll

Type Parameters:

TItem

Syntax:

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.DisExceptionAsync(Exception)ComponentBase.SetParametersAsync(ParameterView)

Constructors

TelerikContextMenu()

Declaration

public TelerikContextMenu()

Properties

ContextMenuSettings

Specifies the component settings. Children: MenuPopupSettings.

Declaration

[Parameter]
public RenderFragment ContextMenuSettings { get; set; }

Property Value

RenderFragment

Data

A collection that contains the ContextMenu items.

Declaration

[Parameter]
public IEnumerable<TItem> Data { get; set; }

Property Value

IEnumerable<TItem>

DisabledField

Defines the Disabled DataField of the DataSource.

Declaration

[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. Children: allows arbitrary content.

Declaration

[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

[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

[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

[Parameter]
public string Selector { get; set; }

Property Value

string

SeparatorField

Defines the Separator DataField of the DataSource.

Declaration

[Parameter]
public string SeparatorField { get; set; }

Property Value

string

Template

Defines the template for the whole context menu. Children: allows arbitrary content.

Declaration

[Parameter]
public RenderFragment<IEnumerable<TItem>> Template { get; set; }

Property Value

RenderFragment<IEnumerable<TItem>>

Methods

BuildRenderTree(RenderTreeBuilder)

Declaration

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder

RenderTreeBuilder

Overrides ComponentBase.BuildRenderTree(RenderTreeBuilder)

Dispose()

Declaration

public override void Dispose()

Overrides BaseComponent.Dispose()

HideAsync()

Hides the context menu.

Declaration

public Task HideAsync()

Returns

Task

OnAfterRenderAsync(bool)

Declaration

protected override Task OnAfterRenderAsync(bool firstRender)

Parameters

firstRender

bool

Returns

Task

Overrides BaseComponent.OnAfterRenderAsync(bool)

Refresh()

Re-renders the component.

Declaration

public void Refresh()

ShowAsync(double, double)

Shows the context menu at defined coordinates.

Declaration

public Task ShowAsync(double clientX, double clientY)

Parameters

clientX

double

Coordinate for X axis.

clientY

double

Coordinate for Y axis.

Returns

Task