We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Paging not working

Hello,

ive enabled paging on my Grid, but he still showing all Entries on one Site. On the footer of the grid i see the Pages and the text: 1 of 9 pages (99 items). But all items are displayed on the first page! If i click through the Pages, nothing happens:

@(Html.EJ().Grid<object>("MitarbeiterGrid")
      .Datasource(ds=>ds.URL("Mitarbeiter2/LoadData").CrudURL("Mitarbeiter2/CrudUpdate").Adaptor(AdaptorType.UrlAdaptor)).AllowPaging()
      .EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.Normal); })
            .ToolbarSettings(toolbar =>
            {
                toolbar.ShowToolbar().ToolbarItems(items =>
                {
                    items.AddTool(ToolBarItems.Add);
                    items.AddTool(ToolBarItems.Edit);
                    items.AddTool(ToolBarItems.Delete);
                    items.AddTool(ToolBarItems.Update);
                    items.AddTool(ToolBarItems.Cancel);
                });
            })
      .Columns(col =>
      {
          col.Field("Id").Visible(false).IsPrimaryKey(true).Add();
          col.Field("Personalnummer").Add();
          col.Field("Vorname").Add();
          col.Field("Nachname").Add();
          col.Field("Email").Add();
          col.Field("Status").ForeignKeyField("wert").ForeignKeyValue("anzeige").DataSource((IEnumerable<object>)ViewBag.datasource1).Add();
          col.Field("MitarbeiterTyp_Id").HeaderText("Mitarbeitertyp").ForeignKeyField("Id").ForeignKeyValue("Typname").DataSource((IEnumerable<object>)ViewBag.datasource).Add();
      })
            )
----------------------------------------------------------------
Controller:

        public JsonResult LoadData()
        {
            ModelContext cont = new ModelContext();
            //cont.Configuration.LazyLoadingEnabled = false;
            var data = cont.Mitarbeiter.Include("MitarbeiterTyp").ToList();
            return Json(new {result= data, count = data.Count }, JsonRequestBehavior.AllowGet);
        }


THanks

2 Replies

AR Arthur June 4, 2016 09:41 PM UTC



SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team June 6, 2016 04:28 AM UTC

Hi Aruthur, 

When using the URLAdaptor in ej.DataManager, you have to handle the Grid actions in the server-side. Please refer to the following for server-side APIs of DataManager. 
 

Regards, 
Seeni Sakthi Kumar S. 


Loader.
Up arrow icon