Skip to main content
All docs
V25.1
  • DxTabs.TabReordering Event

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

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.1.dll

    NuGet Package: DevExpress.Blazor

    Declaration

    [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.

    <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