Hi,
When i try to click on edit while there is a row in edit mode already the row gets removed. Please let me know if anybody have an idea?
I have tried with specifying Model.Id but of no use.
Note: I am using Kendo grid in ASP.NET MVC helper and this grid is loaded by ajax call in jquery by assigning datasource
5 Answers, 1 is accepted
Indeed, this behavior occurs when no Model ID is specified, so I am not sure what else might be causing it. Would you please share the Grid configuration options and the related code as well? That would allow us to investigate further.
Regards,
Alexander Popov
Telerik
See What's Next in App Development. Register for TelerikNEXT.

View containing the Grid configurations
@(Html.Kendo().Grid(Model.ProviderMapList)
.Name("ProviderMapListGrid")
.Pageable(page => page.Enabled(true))
.Sortable()
.Scrollable()
.Navigatable()
.Selectable()
.Groupable()
.HtmlAttributes(new { style = "height:100%;" })
.Pageable(
pager => pager.PageSizes(new int[] { 20, 50, 100 })
)
.Columns(columns =>
{
columns.Template(@<text></text>).HeaderTemplate("<a href='\\#' title=\"Expand All\"><img src='../Content/Images/icon-expand.jpg' onclick=\"javascript:ExpandProviderMapGroups();return false;\"\\>  </a><a href='\\#' title=\"Collapse All\"><img src='../Content/Images/icon-collapse.jpg' onclick=\"javascript:CollapseProviderMapGroups();return false;\" \\></a>").Width(50);
columns.Bound(p => p.Value).ClientGroupHeaderTemplate("Value: #=value#        Count:#=count#");
columns.Bound(p => p.SvcType).ClientGroupHeaderTemplate("SvcType: #=value#        Count:#=count#");
columns.Bound(p => p.FacilityProviderTypeId).EditorTemplateName("ProviderTypes").ClientTemplate("#=FacilityProviderType#").Title("Provider Type").ClientGroupHeaderTemplate("Provider Type: #=value#        Count:#=count#");
columns.Command(command => { command.Edit().HtmlAttributes(new { title = "Edit" }); }).Width(172);
columns.Command(command => { command.Destroy().HtmlAttributes(new { title = "Delete" }); }).Width(172);
})
.DataSource(dataSource => dataSource
.Ajax()
.Aggregates(aggregates => aggregates.Add(p => p.Value).Count())
.Aggregates(aggregates => aggregates.Add(p => p.SvcType).Count())
.Aggregates(aggregates => aggregates.Add(p => p.FacilityProviderTypeId).Count())
.ServerOperation(false)
.Model(model =>
{
model.Id(x => x.ProviderMapId);
model.Field(x => x.FacilityProviderTypeId);
})
.PageSize(20)
.Update(update => update.Action("UpdateProviderMap", "Remit835").Type(HttpVerbs.Post))
.Destroy(update => update.Action("DeleteProviderMap", "Remit835").Type(HttpVerbs.Post))
)
.Resizable(resize => resize.Columns(true))
.Reorderable(reorder => reorder.Columns(true))
.Events(events => events.Cancel("onCancel"))
)
Javascript function that is binding the data to the grid
function Remit835Call(facilityId) {
blockUI
var model = new Object();
model.FacilityId = facilityId;
var providerMapListGrid = $('#ProviderMapListGrid');
var payerTypeListGrid = $('#PayerTypeGrid');
var payerTypeMasterListGrid = $('#PayerTypeMasterGrid');
blockUI();
var successCallbackMethod = function (response) {
var providerMapGrid = providerMapListGrid.data("kendoGrid");
var providerMapDatasource = providerMapGrid.dataSource;
providerMapDatasource.data(response.reply.data.ProviderMapList);
unblockUI();
};
var errorCallbackMethod = function (reply) {
alert(reply);
unblockUI();
}
$.ajax({
type: 'GET',
url: Remit835Setup,
data: model,
cache: false,
dataType: 'json',
contentType: 'application/json',
success: successCallbackMethod,
error: errorCallbackMethod
});
}
Controller action that is sending data to the ajax call
public JsonResult Remit835FacilityFilter(Remit835Filter filter)
{
Remit835SearchModel remit835SearchModel = new Remit835SearchModel();
var remit835ProviderMapDto = _remit835FacilityService.PopulateProviderMapList(filter.FacilityId);
remit835SearchModel.ProviderMapList = (from o in remit835ProviderMapDto
select new Remit835ProviderMapViewModel()
{
ProviderMapId = o.ProviderMapId,
FacilityName = o.FacilityName,
FacilityProviderType = o.FacilityProviderType,
Value = o.Value,
SvcType = o.SvcType,
FacilityId = o.FacilityId,
FacilityProviderTypeId = o.FacilityProviderTypeId,
InsertUser = o.InsertUser,
ProviderTypeList = FillFacilityProviderTypes(),
}).ToList();
JsonResult jsonResult = Json(
new
{
reply = new
{
data = remit835SearchModel
}
}
, JsonRequestBehavior.AllowGet);
return jsonResult;
}
Thank you for the provided code snippets. The behavior is expected when working with server editing and there is no workaround that I could recommend, other than using Ajax editing instead.
Regards,
Alexander Popov
Telerik

Hi Alexander,
Thanks for the response. If you can see the code snippet in the view i do have mentioned datasource.Ajax(). But still when you click edit button while there is another editing row available the existing and later all the rows of the grid disappears.
Appreciate your thoughts on this.
I apologize for missing that. I reviewed the code again, however I did not notice anything suspicious and so far I was unable to reproduce this behavior locally. I am also not sure how and when the Remit835Call function is called, but it seem it replaced the Grid's DataSource items. Would you be able to provide a runnable sample project where this is isolated, so we can investigate further? You might need opening a new support ticket, as the attachment size in the forums is limited to 2mb.
Regards,
Alexander Popov
Telerik