This question is locked. New answers and comments are not allowed.
I have a grid like this. The grid is inside a partial view.
@{ Html.Kendo().Grid<IEnumerable.............>() .Name("IniParamGrid") .HtmlAttributes(new { style = "width: 100%;" }) .Events(events => events.DataBound("Grid_onRowDataBound")) .Events(events => events.Change("Grid_OnRowSelectUID")) .AutoBind(false) .Columns(col => { col.Bound("NP_PARAM_UID").Hidden(); col.Bound("PROCESS_GRP").Title("Process Group").HeaderHtmlAttributes(new { style = "text-align:center;" }); col.Bound("PARAM_NAME").Title("Parameter Name").HeaderHtmlAttributes(new { style = "text-align:center;" }); col.Bound("PARAM_VALUE").Title("Parameter Value").HeaderHtmlAttributes(new { style = "text-align:center;" }); col.Bound("EXTERNAL_ID").Title("Table Name").HeaderHtmlAttributes(new { style = "text-align:center;" }); col.Bound("EXTERNAL_FK").Title("Key Value").HeaderHtmlAttributes(new { style = "text-align:center;" }); col.Bound("DEL_FLG").Hidden(); }) .DataSource(dataBinding => { dataBinding.Ajax().Read(read => read.Action("SrchDataIniParam", "Admin", new { area = "Admin", strParam1 = ViewBag.Param1, })) .ServerOperation(false); }) .Resizable(resizing => resizing.Columns(true)) .Selectable() .Reorderable(reorder => reorder.Columns(true)) .Pageable() .Sortable() .Filterable() .Render();}
My Controller code looks like this
[HttpPost]
public ActionResult SearchIniInitiator(string txtSrchPrGrp)
{
ViewBag.Param1 = txtSrchPrGrp;
return PartialView("SubForms/_Search");
}
public ActionResult SrchDataIniParam(string strParam1, [DataSourceRequest] DataSourceRequest request)
{
MyDate objdata = new MyDate ();
return Json(objdata .getListstrParam1).ToDataSourceResult(request));
}
I am submitting the form from javascript (form.submit()) which call the "SearchIniInitiator" action result which inturn calls the "SrchDataIniParam" param to populate the grid. This is working as expected.
But what I see is that the "SrchDataIniParam" function is getting called twice.
The same code is working with Telerik grid perfectly but why Kendo grid is calling it twice.
Please help.