Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxTabs.TabReordering Event

Fires after a user drops a tab to a new position.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public EventCallback<TabReorderEventArgs> TabReordering { get; set; }

#Event Data

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

Property Description
Cancel Gets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs.
FromIndex Returns the index (according to the component markup) of the start tab position.
FromTabInfo Returns information about the tab being moved.
ToIndex Returns the index (according to the component markup) of the end tab position.
ToTabInfo Returns information about the destination tab.

#Remarks

When the AllowTabReorder property is set true, users can reorder tabs by dragging them to a different position. Once a user drops a tab onto a new position, the component raises the TabReordering event. Handle the event to perform custom actions and cancel the operation if necessary.

The following example restricts the last tab from being moved from its position.

razor
<DxTabs AllowTabReorder="true" TabReordering="@TabReordering">
    <DxTab Text="The 1st Tab" />
    <DxTab Text="The 2nd Tab" />
    <DxTab Text="The 3rd Tab" />
    <DxTab Text="The 4th Tab" />
    <DxTab Text="The Last Tab" />
</DxTabs>

@code {
    void TabReordering(TabReorderEventArgs e) {
        if ((e.FromIndex == 4) || (e.ToIndex == 4)) {
            e.Cancel = true;
        }
    }
}
See Also