Completed
Last Updated: 21 May 2019 10:57 by ADMIN
Release 1.1.0
Gert
Created on: 03 May 2019 12:49
Category: TabStrip
Type: Feature Request
6
Expose Current Tab Title

At the moment, you can't get the currently active tab with code, the Title property of the tabs is not public.

Ideally, something like this should work:

@using Telerik.Blazor.Components.TabStrip
@using Telerik.Blazor.Components.Button
 
<TelerikButton OnClick="@WriteActiveTab">Get Active Tab</TelerikButton>
 
<TelerikTabStrip TabPosition="Telerik.Blazor.Components.TabStrip.TabPosition.Left" ref="@myTabStrip">
    <TelerikTab Title="First">
        First tab content.
    </TelerikTab>
    <TelerikTab Title="Second" Disabled="true">
        Secont tab content. This tab is disabled and you cannot select it.
    </TelerikTab>
    <TelerikTab Title="Third">
        Third tab content.
    </TelerikTab>
</TelerikTabStrip>
 
@functions {
    Telerik.Blazor.Components.TabStrip.TelerikTabStrip myTabStrip;
 
    protected void WriteActiveTab()
    {
        Console.WriteLine(myTabStrip.ActiveTab.Title);//Title is not available now
    }
}

 

ADMIN EDIT: As of October 2023, the TabStrip supports getting and setting the active tab with the ActiveTabIndex parameter. This request was marked as Complete when we exposed a Title parameter for the TabStripTab component. Enhanced programmatic access to TabStrip tab IDs can be implemented as part of TabStrip dynamic (closable) tabs.

3 comments
ADMIN
Marin Bratanov
Posted on: 06 May 2019 13:18
Hi Gert,

I encourage you to create new public requests for a tab index exposed from the tab strip, for an ID exposed by the tab, and for a tab changed event. This will keep each idea separate and easy to track, so they can get implemented.


Regards,
Marin Bratanov
Progress TelerikUI for Blazor
Gert
Posted on: 04 May 2019 14:30

And ActivTabChangedEvent ?

 

Anyway , a public propertytrip.ActiveTab.Title   would be enough for now !

Gert
Posted on: 04 May 2019 14:28

Perfect !

 

Maybe also :

 

Console.WriteLine(myTabStrip.ActiveTab.Title);

Console.WriteLine(myTabStrip.ActiveTab.Id);

Console.WriteLine(myTabStrip.SelectedIndex;