Hi all
I have a problem with an Telerik Grid.
Until I can editing direct in the Grid (with AJAX), i have the following problem:
If i’ll editing all data from a line, i go to a editing window with this command:
columns.Command(commands => { commands.Custom("editDetail") .ButtonType(type) .HtmlAttributes(new { @class = "editDetail" }) .Text("edit") .DataRouteValues(route => route.Add(o => o.GeschaeftID).RouteKey("GeschaeftID")) .Ajax(false) .Action("Edit", "Geschaeft"); }).Width(38).Title("");When i finished with the editing, i get back to the site with the Grid.
And now i‘ve lost all filters and sortings.
If i don’t need the AJAX for edting direct in the Grid i don’t loosing the filter and sortings.
I guess the problem ist by the AJAX.
Do you have an idea, what to do that i don't lose the filters and sortings when i using AJAX?
This is my Code:
@(Html.Telerik().Grid<Model>() .Name("Grid") .DataKeys(keys => keys.Add(c => c.GeschaeftID)) .ToolBar(commands => { commands.SubmitChanges(); }) .DataBinding(dataBinding => dataBinding.Ajax() .Select("_Index", "Geschaeft") .Update("_SaveBatchEditing", "Geschaeft") ) .Columns(columns => { columns.Command(commands => { commands.Custom("editDetail") .ButtonType(type) .HtmlAttributes(new { @class = "editDetail" }) .Text("edit") .DataRouteValues(route => route.Add(o => o.GeschaeftID).RouteKey("GeschaeftID")) .Ajax(false) .Action("Edit", "Geschaeft"); }).Width(38).Title(""); columns.Bound(o => o.xy) .ClientTemplate("<#=xy? 'ja' : 'nein' #>") .Title("A") .HeaderHtmlAttributes(new { title = "xy" }) .Width(12); columns.Bound(o => o.xz) .Width(84) .Title("xz") .ReadOnly() .ClientTemplate("<#=xz#>"); columns.Bound(o => o.xf) .Title("xf") .Width(250) .ReadOnly(); }) .DetailView(details => details.ClientTemplate( Html.Telerik().Grid<Model>() .Name("V") .Columns(columns => { columns.Bound(o => o.vx) .Width(90) .Title("vx") .ReadOnly(); columns.Bound(o => o.vz) .Title("vz") .ReadOnly(); }) .DataBinding(dataBinding => dataBinding.Ajax() .Select("_DetailViewAjax", "Geschaeft", new { geschaeftID = "<#= GeschaeftID #>" })) .ToHtmlString() )) .ClientEvents(events => events .OnDataBinding("Grid_onDataBinding") .OnError("Grid_onError")) .Editable(editing => editing.Mode(GridEditMode.InCell)) .Scrollable(scrolling => scrolling.Enabled(false).Height("auto")) .TableHtmlAttributes(new { style = "table-layout = fixed" }) .Resizable(resizing => resizing.Columns(true)) .Sortable() .Filterable() .Groupable() .Pageable(paging => paging .PageSize(ViewBag.PageSize) .Style(GridPagerStyles.Status) .Position(GridPagerPosition.Bottom) ) )