This question is locked. New answers and comments are not allowed.
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
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