Can RadzenTabs `private List<RadzenTabsItem> tabs` have a public read accessor?

Hi there, this is my use-case:

My RadzenTabs has a dynamic amount of tabs and added during runtime based on conditions.

Based on user-actions I sometimes want to programmatically set the selected tab to a specific one. I'm doing that by updating the SelectedIndex (If there's a better way to do this, lemme know :slight_smile: )

So anyways, it's rather complicated to find the correct tab to select by index alone. RadzenTabs.Tabs (capitalized) is just returning a RenderFragment, so that seems kinda useless to access them programmatically, but RadzenTabs.tabs (lowercase) is returning the actual tab classes.

Through this property I'm able to determine by name in which index location a certain tab is, and change the selected index to the correct.

An alternative would be to have method that lets me set the selected tab index by title

Hi @RonSijm,

We don't want to make that collection public as people will try to add / remove items to it and expect the tabs to update (they won't). I would recommend to keep a separate collection of tab texts which would allow you to find a tab's index quickly.

Hi Korchev,

I have a similar issue, in my case I would like to customize the RadzenTabs and create a custom control. In order to do so, the "tabs" need to be public. Keeping a separate collection of tabs would mean double work in my case. Per your comment, I am sure people will always have expectations of how this would work, but managing these expectations might be an impossible job.

Why do you want access to that collection? What do you plan to do with it?

I have a derived class that extends the Radzetabs and I have a Tabitem that extends the Radzentabsitem. Each Tabitem has its own Templateform, upon initializing of the Tabs I already know if the templateform is valid or not. Upon changing of the tabs I do validate the TabItem. Hence I always have a validated state of a tabitem.

I would like to be able to loop the tabs(collection) to check if a tab is valid, and set focus and color if it is not valid before saving the page.

Hi @Mickey,

You can implement this in a similar way to how RadzenTabsItem works. Override OnInitialized and notify the parent that a tab has been added. We really don't want to make this collection public because of the issues I have already mentioned.

@korchev : Thanks! Works like a charm!