This is a migrated thread and some comments may be shown as answers.

[Solved] SelectedIndex/Selected

1 Answer 87 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Michael Strasser
Top achievements
Rank 1
Michael Strasser asked on 17 Nov 2009, 05:26 PM
It seems that the .SelectedIndex(0) or .Selected(true) are not working as expected when tab is defined using LoadContentFrom().

Using one (or both) assignments does select the tab, but does not actually load the content.  In the UI, the user has to click a different tab, then click back on the 1st tab to get the contents to load.

In the example below, I'm showing the .Selected(true) on the 1st item, and the .SelectedIndex(0) for examination.  I've tried using one or the other, and both at the same time.

Html.Telerik().TabStrip()
      .Name("Tab" + staff.Id.ToString())
      .Items(parent =>
      {
           parent.Add()
              .Text("Person")
              .LoadContentFrom(Url.Action("PartialViewPerson", "Staff", new { organizationId = staff.OrganizationId, staffId = staff.Id }))
              .Selected(true);                        
           parent.Add()
               .Text("Contact Method")
               .LoadContentFrom(Url.Action("PartialViewContactMethod", "Staff", new { organizationId = staff.OrganizationId, staffId = staff.Id }));
           parent.Add()
          .Text("Postal Address")
          .LoadContentFrom(Url.Action("PartialViewPostalAddress", "Staff", new { organizationId = staff.OrganizationId, staffId = staff.Id }));
      }
)
.SelectedIndex(0)
.Render();

Am I doing something wrong?

Thanks!
M.A.Strasser

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 18 Nov 2009, 02:39 PM
Hi Michael,

The required behavior is expected in the official beta release of the components. I have attached a latest build which includes it.

All the best,
Georgi Krustev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
TabStrip
Asked by
Michael Strasser
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or