In this grid, I have a .DetailView with a TabStrip as the ClientTemplate.
Question: is there any way to know what the current row index is (or row datakey) in my TabStrip BindTo() method? The Server-side "<#= >" tags are working when naming the TabStrip like so: .Name("TabStrip_<#= GridRowId #>")
But the .BindTo() seems to be taking the "<#= GridRowId #>" literally
.DetailView(details => details.ClientTemplate(
Html.Telerik().TabStrip()
.Name("TabStrip_<#= GridRowId #>")
.SelectedIndex(0)
.BindTo(Model["<#= GridRowId #>"], (item, tabs) =>
{
foreach (TemplateTab tab in tabs)
{
item.Text = tab.TabText;
item.ActionName = tab.LoadContentFromAction;
item.ControllerName = tab.LoadContentFromController;
}
})
.ToHtmlString()
))
I've also tried something similar without the .BindTo, and same results. If I hard-code the "12" in my Model (which is a dictionary), it works. But if I use Model["<#= GridRowId #>"], again the string within the quotes is taken literally:
.DetailView(details => details.ClientTemplate(
Html.Telerik().TabStrip()
.Name("TabStrip_<#= GridRowId #>")
.SelectedIndex(0)
.Items(tabstrip =>
{
foreach (var tab in Model["12"])
{
tabstrip.Add()
.Text(tab.TabText)
.LoadContentFrom(tab.LoadContentFromAction, tab.LoadContentFromController, new { BoardingTaskID = tab.BoardingTaskId, EdocTemplateID = tab.EdocTemplateId, SessionId = tab.SessionId, IsReadOnly = tab.IsReadOnly });
}
}
)
.ToHtmlString()
))