我希望我的Telerik网格上的.DetailView默认打开(展开)。每行总会有一个.DetailView。我可以在网格中应用设置吗?我搜索过但找不到任何文档。有没有办法用javascript做到这一点?
谢谢!
编辑添加网格的精简版本:
@( Html.Telerik().Grid<Stuff>()
.Name("StuffGrid")
.DataKeys(dataKeys =>
{
dataKeys.Add(d => d.Id).RouteKey("id");
})
.DataBinding(dataBinding =>
{
dataBinding.Ajax()
.Select("", "")
.Delete("", "");
})
.Columns(columns =>
{
columns.Bound("");
columns.Bound("");
columns.Command(c =>
{
c.Delete();
});
})
.ClientEvents(events => events.OnDataBinding("").OnDelete(""))
.DetailView(v => v.ClientTemplate(
Html.Telerik().TabStrip()
.Name("TabStrip_<#= Id #>")
.SelectedIndex(0)
.Items(items =>
{
items.Add().Text("Dates").Content(
Html.Telerik().Grid<Date>()
.Name("Dates_<#= Id #>")
.Columns(columns =>
{
columns.Bound("");
columns.Bound("");
})
.DataBinding(dataBinding =>
{
dataBinding.Ajax().Select("", "", new { id = "", id = "" });
})
.ClientEvents(events => events.OnDataBinding(""))
.ToHtmlString());
items.Add().Text("Details").Content(
Html.Telerik().Grid<Details>()
.Name("Details_<#= Id #>")
.DataKeys(dataKeys => dataKeys.Add('').RouteKey(""))
.DataBinding(dataBinding =>
{
dataBinding.Ajax().Select("", "", new { id = "", detailId = "" });
})
.Columns(columns =>
{
columns.Bound("");
columns.Bound("");
})
.ClientEvents(events =>
{
events.OnDataBinding("");
})
.NoRecordsTemplate("")
.ToHtmlString());
})
.ToHtmlString()
))
)