Back to Devexpress

DxTabBase.Click Event

blazor-devexpress-dot-blazor-dot-base-dot-dxtabbase-5a99d111.md

latest1.8 KB
Original Source

DxTabBase.Click Event

Fires when a user clicks the tab.

Namespace : DevExpress.Blazor.Base

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[Parameter]
public EventCallback<TabClickEventArgs> Click { get; set; }

Event Data

The Click event's data class is TabClickEventArgs. The following properties provide information specific to this event:

PropertyDescription
MouseEventArgsThe Blazor’s built-in MouseEventArgs event arguments.
TabIndexGets the clicked tab’s index.
TabInfoReturns information about a tab related to the event.

Remarks

Use the Click event to specify individual click handlers for tabs. You can also use the DxTabs.TabClick event to specify a common click handler for all tabs.

razor
<DxTabs>
    <DxTab Text="Home" Click="OnTabClick"></DxTab>
    <DxTab Text="Products"></DxTab>
    <DxTab Text="Support"></DxTab>
</DxTabs>

@Alert

@code {
    public string Alert { get; set; } = "";

    void OnTabClick(TabClickEventArgs e) {
        Alert = $"`Home` tab has been clicked";
    }
}

See Also

DxTabBase Class

DxTabBase Members

DevExpress.Blazor.Base Namespace