This question is locked. New answers and comments are not allowed.
I'm newer in Telerik MVC controls. I met a bug when I was using incell editing model. The following are reproduce steps:
1. Click "Add new record" button
2. Change to other page by clicking the pager link.
3. Browser will prompt confirmation: You are going to lose any unsaved changes. Are you sure?
4. Click "Yes" to give up the any changes.
5. Page changed, but if you click the first row to edit it, you will meet the bug, the edit box shows blank instead of original content.
My solution:
The version of MVC control is: Q1 2011 517
@(Html.Telerik().Grid<Role>() .Name("Grid") .DataKeys(keys => { keys.Add(r => r.RoleId); }) .ToolBar(commands => { commands.Insert(); commands.SubmitChanges(); }) .DataBinding(dataBinding => dataBinding.Ajax() .Select("_SelectBatchEditing", "Account") .Update("_SaveBatchEditing", "Account") ) .Columns(columns => { columns.Bound(r => r.RoleName).Width(200); columns.Bound(r => r.RoleDesc).Width(500); columns.Bound(r => r.IsDeleted).ClientTemplate("<input type='checkbox' disabled='disabled' name='IsDeleted' <#= IsDeleted? checked='checked' : '' #> />"); }) .ClientEvents(events => events.OnDataBinding("Grid_onDataBinding").OnError("Grid_onError")) .Editable(editing => editing.Mode(GridEditMode.InCell).DefaultDataItem(new Role())) .Pageable(paging => paging.Style(GridPagerStyles.PageInput | GridPagerStyles.Numeric | GridPagerStyles.NextPrevious)) .Resizable(resizing => resizing.Columns(true)) .Reorderable(reorder => reorder.Columns(true)) .Pageable() .Sortable())1. Click "Add new record" button
2. Change to other page by clicking the pager link.
3. Browser will prompt confirmation: You are going to lose any unsaved changes. Are you sure?
4. Click "Yes" to give up the any changes.
5. Page changed, but if you click the first row to edit it, you will meet the bug, the edit box shows blank instead of original content.
My solution:
function Grid_onDataBinding(e) { var grid = $(this).data('tGrid'); if (grid.hasChanges()) { if (!confirm('You are going to lose any unsaved changes. Are you sure?')) { e.preventDefault(); } else { $(".t-grid-cancel-changes").click(); } }}The version of MVC control is: Q1 2011 517