This question is locked. New answers and comments are not allowed.
I have Grid with Master/detail binding, and it display fine, my details grid have edit button , the problem is when I click on one of edit buttons in detail grid the page postback and then Grid show collapsed, it means the grid which is in grid mode is not expanded and I should do it manually, how should I fix this?
Here is my Grid code:
<% Html.Telerik().Grid(Model)
.Name("Grid")
.DataKeys(keys => keys.Add(p => p.Id).RouteKey("Id"))
.DataBinding(dataBinding => dataBinding.Server()
.Insert("Insert", "Request")
.Delete("Delete", "Request")
.Update("Editing", "Request")
)
.Columns(columns =>
{
columns.Bound(p => p.Id).Width(40).Visible(true);
columns.Bound(p => p.Customer).Title("Customer").Width(180);
columns.Bound(p => p.Address).Width(180);
columns.Bound(p => p.State).Width(80);
columns.Bound(p => p.StartDate).Width(80);
columns.Bound(p => p.EndDate).Width(80);
columns.Bound(p => p.OptionA).Title("A").Width(40);
columns.Bound(p => p.OptionB).Title("B").Width(40);
columns.Bound(p => p.OptionC).Title("C").Width(40);
columns.Bound(p => p.OptionD).Title("D").Width(40);
columns.Bound(p => p.Description).Title("Additional Informaition").Width(140);
columns.Bound(c => c.Id).Template(c =>
{
%>
<%=Html.ActionLink("View Keywords", "Index", "Keyword", new { c.Id }, null)%>
<%
}).Title("Tags").Visible(true);
columns.Command(commands =>
{
commands.Edit();
commands.Delete();
}).Title("Commands");
})
.DetailView(detailView => detailView.Template(e =>
{
%>
<% Html.Telerik().Grid(e.CustomerRssChannelKeywords)
.DataKeys(keys => keys.Add(c => c.Id))
.DataBinding(dataBinding => dataBinding.Server()
.Update("UpdateKeyword", "Request")
.Delete("DeleteKeyword", "Request")
)
.Name("CustomerRssChannelKeywords_" + e.Id)
.Columns(columns =>
{
columns.Bound(o => o.Id).Title("Id").Width(80).Visible(true);
columns.Bound(o => o.Phrase).Width(101);
columns.Bound(o => o.Option).Width(140);
columns.Command(commands =>
{
commands.Edit();
commands.Delete();
}).Width(200).Title("Commands");
})
.Sortable()
.Render();
%>
<%
}))
.Editable(editing => editing.Mode(GridEditMode.InLine))
.Pageable(paging => paging.Enabled(true).PageSize(10))
.Scrollable(scrolling => scrolling.Height(300)).Sortable().Filterable().Render();
%>
Here is my Grid code:
<% Html.Telerik().Grid(Model)
.Name("Grid")
.DataKeys(keys => keys.Add(p => p.Id).RouteKey("Id"))
.DataBinding(dataBinding => dataBinding.Server()
.Insert("Insert", "Request")
.Delete("Delete", "Request")
.Update("Editing", "Request")
)
.Columns(columns =>
{
columns.Bound(p => p.Id).Width(40).Visible(true);
columns.Bound(p => p.Customer).Title("Customer").Width(180);
columns.Bound(p => p.Address).Width(180);
columns.Bound(p => p.State).Width(80);
columns.Bound(p => p.StartDate).Width(80);
columns.Bound(p => p.EndDate).Width(80);
columns.Bound(p => p.OptionA).Title("A").Width(40);
columns.Bound(p => p.OptionB).Title("B").Width(40);
columns.Bound(p => p.OptionC).Title("C").Width(40);
columns.Bound(p => p.OptionD).Title("D").Width(40);
columns.Bound(p => p.Description).Title("Additional Informaition").Width(140);
columns.Bound(c => c.Id).Template(c =>
{
%>
<%=Html.ActionLink("View Keywords", "Index", "Keyword", new { c.Id }, null)%>
<%
}).Title("Tags").Visible(true);
columns.Command(commands =>
{
commands.Edit();
commands.Delete();
}).Title("Commands");
})
.DetailView(detailView => detailView.Template(e =>
{
%>
<% Html.Telerik().Grid(e.CustomerRssChannelKeywords)
.DataKeys(keys => keys.Add(c => c.Id))
.DataBinding(dataBinding => dataBinding.Server()
.Update("UpdateKeyword", "Request")
.Delete("DeleteKeyword", "Request")
)
.Name("CustomerRssChannelKeywords_" + e.Id)
.Columns(columns =>
{
columns.Bound(o => o.Id).Title("Id").Width(80).Visible(true);
columns.Bound(o => o.Phrase).Width(101);
columns.Bound(o => o.Option).Width(140);
columns.Command(commands =>
{
commands.Edit();
commands.Delete();
}).Width(200).Title("Commands");
})
.Sortable()
.Render();
%>
<%
}))
.Editable(editing => editing.Mode(GridEditMode.InLine))
.Pageable(paging => paging.Enabled(true).PageSize(10))
.Scrollable(scrolling => scrolling.Height(300)).Sortable().Filterable().Render();
%>