RadzenTabsItem Text Template?

Is it possible to use a template for the Text on the tab?

As be nice to be able to put things like a TextBox in it for people to change the tab name on the fly, or be able to put an IconButton (X) so people could click that and remove the current tab.

1 Like

:man_facepalming: Sorry, I should have checked the code base. I was trying to set the template as a property like an idiot. Thank you

Actually, it doesn't seem to be working? I am using it like this

                    <RadzenTabsItem>
                        <Template Context="tabContext">
                            @if (tabContext.IsSelected)
                            {
                                <RadzenTextBox Style="width: 50px" Name="Tab Name" Placeholder="Tab Name" @bind-Value="@tab.Name" aria-label="Tab Name"/>
                            }
                            else
                            {
                                @tab.Name
                            }
                        </Template>

But when I build I get this error

ContentTypeEditor.razor(46, 25): [RZ9996] Unrecognized child content inside component 'RadzenTabsItem'. The component 'RadzenTabsItem' accepts child content through the following top-level items: 'Template', 'ChildContent'.

What have I done wrong?

When you set Template you have to use ChildContent. This i show Blazor works and the cause of the exception.

<RadzenTabsItem>
     <Template>
          Tab text
     </Template>
     <ChildContent>
          Tab content
     </ChildContent>
</RadzenTabsItem>
1 Like

Of course :man_facepalming: Thank you