TabStrip .Selected(true) and .SelectedIndex(...) broken

0 Answers 240 Views
TabStrip
Bradley
Top achievements
Rank 1
Bradley asked on 17 Mar 2023, 05:19 AM

Hi all,

I'm having an issue with my TabStrip code.

Basically, .Selected and .SelectedIndex do not work to open the given tab when the page loads. I have to manually click on a tab to display it, and there is some strange formatting that makes it seem like the desired tab was selected but it was never displayed (borders around the tab etc).

I can pinpoint precisely the version of the NuGet package where this problem is introduced, and can confirm it exists up to the latest.

Code excerpt:

@(Html.Kendo().TabStrip()
    .Name(Model.SessionId + "_SessionPanelTabStrip")
    .Animation(animation => animation.Open(effect => effect.Fade(FadeDirection.In)))
    .Items(ts =>
    {
        ts.Add().Text("General")
            .Selected(true)
            .LoadContentFrom("SessionPanelGeneral", "Sessions", new {sessionId = Model.SessionId});
and this goes on further. This code works as expected up to and including the NuGet package Telerik.UI.for.AspNet.Core 2022.2.621. Any version after that, from 2022.2.802 up to and including the latest as of writing this post (2023.1.314) exhibit the issue where the tab is not selected by default when .Selected is true. 

For now I am just using the older version that is working, but I would like to upgrade at some stage to get all of the other changes in later versions. It would great if this could be fixed, whether on my end or in a future release.

Thanks
Stoyan
Telerik team
commented on 21 Mar 2023, 05:15 PM

Hi Bradley,

I've encountered a similar issue recently and it turned out to be caused because the client-side resources of Kendo UI weren't update to match the version of the NuGet package Telerik.UI.for.AspNet.Core.

These are usually configured in the _Layout.cshtml file located in the /View/Shared directory of your project.

        <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2023.1.117/styles/kendo.default-ocean-blue.min.css">
	<script src="https://cdn.kendostatic.com/2023.1.117/js/jquery.min.js"></script>
	<script src="https://cdn.kendostatic.com/2023.1.117/js/jszip.min.js"></script>
	<script src="https://cdn.kendostatic.com/2023.1.117/js/kendo.all.min.js"></script>
	<script src="https://cdn.kendostatic.com/2023.1.117/js/kendo.aspnetmvc.min.js"></script>

Could you please ensure that is not the case and let me know if the issue persists on your side?

Looking forward to your reply.

Bradley
Top achievements
Rank 1
commented on 28 Jun 2023, 05:29 AM

Hi Stoyan,

Sorry for the late reply here - I didn't see that I had received an answer!

Thanks a bunch for that, this resolved my problems. Much happier now :)

Thanks.

No answers yet. Maybe you can help?

Tags
TabStrip
Asked by
Bradley
Top achievements
Rank 1
Share this question
or