This is a migrated thread and some comments may be shown as answers.

Sort, Paging,Filtering not working even after setting Server Operation to false

0 Answers 187 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Arathy
Top achievements
Rank 1
Arathy asked on 19 Nov 2012, 09:09 AM
My code is given below
VIEW:-
@model IEnumerable<SampleKendo.Models.TestModel>
@using Kendo.Mvc.UI
@using Kendo.Mvc.UI.Fluent
@using SampleKendo.Models


@(Html.Kendo().Grid(Model)    
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.Id).Groupable(false);
        columns.Bound(p => p.Name);
        columns.Bound(p => p.Age);
        
        
    })
   
    .Pageable()
   
    .Scrollable()
    .Filterable()
    .Sortable()


     .DataSource(dataSource => dataSource
            .Ajax()
           
              .ServerOperation(false)  
          
            
               .Read(read=>read.Action("GetDepartment","Test")))


        )

Controller:_
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Kendo.Mvc.Extensions;
using Kendo.Mvc.UI;
using SampleKendo.Models;


using System.Web.Mvc;




namespace SampleKendo.Controllers
{
    public class TestController : Controller
    {
        //
        // GET: /Test/


      
        public ActionResult Index()
        {
            return View(GetDepartmentData());


        }




        public ActionResult GetDepartment([DataSourceRequest] DataSourceRequest request)
        {
            return Json(GetDepartmentData().ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
        }


       




        private static IEnumerable<TestModel> GetDepartmentData()
        {
            var db = new DBPULSEEntities();
            return db.DEPARTMENTs.Select(c =>
                                         new TestModel
                                             {
                                                 Id = c.Id,
                                                 Age = c.Age,
                                                 Name = c.Name,
                                                 Birthday = c.Birthday


                                             });
        }
    }
}

I have set the ServerOperation() to false..  but still its not working



When i try to sort, or filter the result is per given in the pic

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Arathy
Top achievements
Rank 1
Share this question
or