blazor-devexpress-dot-blazor-dot-dxribbon-23181bb4.md
Fires when a user clicks a Ribbon tab caption.
Namespace : DevExpress.Blazor
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
[DefaultValue(null)]
[Parameter]
public EventCallback<RibbonTabClickEventArgs> TabClick { get; set; }
The TabClick event's data class is RibbonTabClickEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| Element | Returns information about a clicked Ribbon element. Inherited from RibbonElementClickEventArgs. |
| MouseEventArgs | The Blazor’s built-in MouseEventArgs event arguments. Inherited from RibbonElementClickEventArgs. |
| Tab | Returns information about a clicked Ribbon tab. |
Handle the TabClick event to perform custom actions when a user clicks a caption of any Ribbon tab, except for the application tab. To handle application tab clicks, use the ApplicationTabClick event.
<DxRibbon TabClick="OnTabClick">
<DxRibbonTab Text="Home"></DxRibbonTab>
<DxRibbonTab Text="Insert"></DxRibbonTab>
<DxRibbonTab Text="Review"></DxRibbonTab>
</DxRibbon>
<p>@Notification</p>
@code {
string Notification = "Click any tab";
void OnTabClick(RibbonTabClickEventArgs args)
{
Notification = $@"You selected ""{args.Tab.Text}"" tab";
}
}
If you prefer to attach a listener directly to each tab, use the Click event.
See Also