Hi all,
I am losing paging/sorting after I open a popup window containing another grid inside it.
I noticed that the problem occurs if I use "GridOperationMode.Client" in the grid. I am just curious why this would affect my main Grid.
Here is a partial content of my code:
CONTROLLER:
----------------------
[GridAction]
public ActionResult SelectAjaxEntityHistory(Guid entityID)
{
return View("_EntityHistoryPartial", new GridModel(GetEntityHistory(entityID)));
}
public ActionResult _SelectAjaxEntityHistory(Guid entityID)
{
return PartialView("_EntityHistoryPartial", GetEntityHistory(entityID));
}
VIEW:
---------
...
@(Html.Telerik().Grid(Model)
.Name("Grid_Main")
.DataKeys(keys =>
{
keys.Add(p => p.ID);
})
...
@(Html.Telerik().Window()
.Name("windowObject")
.Visible(false)
...
.Content(@<img src="@Url.Content("~/Content/Common/loading.gif")" alt="loading" />)
)
function openWindow(entityID) {
var window = $("#windowObject").data("tWindow");
window.ajaxRequest('@Url.Action("_SelectAjaxEntityHistory", "SccmSite")', { entityID: entityID });
}
PARTIAL VIEW (_EntityHistoryPartial.cshtml):
--------------------------------------------------------------
...
@(Html.Telerik().Grid(Model)
.Name("Grid2")
.DataKeys(keys =>
{
keys.Add(p => p.EntityHistoryID);
})
.DataBinding(dataBinding =>
{
dataBinding.Ajax()
.OperationMode(GridOperationMode.Client);
.Select("SelectAjaxEntityHistory", "SccmSite"); //this will be used only if "GridOperationMode.Server" is set
})
... ... ...
If I change it to GridOperationMode.Server then the main Grid paging/sorting works fine.
Why? Thanks