TabStrip Titles - Reading from a DataTable

1 Answer 52 Views
TabStrip
cmarsh
Top achievements
Rank 1
Iron
cmarsh asked on 31 Jan 2023, 09:58 PM

I would like to know if it's possible to read the "Title" from code, a database table versus it being in the razor text. If it is possible, any example would be great to share. I'd like this title to be more flexible and user-defined.


<TabStripTab Title="PowerBI Dashboard #1">
        <div class="h_iframe">
            <iframe src=@TargetUrl frameborder="0" allowfullscreen />
        </div>
    </TabStripTab>
    <TabStripTab Title="PowerBI Dashboard #2">
        <div class="h_iframe">
            <iframe src=@TargetUrl2 frameborder="0" allowfullscreen />
        </div>
    </TabStripTab>

Thanks!

1 Answer, 1 is accepted

Sort by
0
Yanislav
Telerik team
answered on 03 Feb 2023, 11:35 AM

Hello Chris,

The Title configuration can be bound to a property. This means you can fetch the data from the DB and assign the retrieved value to this property.

Here is a simple example that demonstrates the approach:
https://blazorrepl.telerik.com/QduGaHvl27uqf4DU38

I've simplified it by using a method in which you can execute the logic to fetch the DB and return the value that has to be used as Title.

I hope this helps.

Regards,
Yanislav
Progress Telerik

Learn about the important changes coming in UI for Blazor 4.0 in January 2023!
Tags
TabStrip
Asked by
cmarsh
Top achievements
Rank 1
Iron
Answers by
Yanislav
Telerik team
Share this question
or