Click here to Skip to main content
15,880,469 members
Please Sign up or sign in to vote.
4.75/5 (3 votes)
See more:
Hi,
I want to implement Grid using KendoUI in MVC 3.0
But the sorting and filtering does not work.
the code of .cshtml file is :
@(Html.Kendo().Grid(Model)
    .Name("Grid")
    .Sortable(sort => sort.SortMode(GridSortMode.MultipleColumn))
    .Columns(columns =>
    {
        columns.Bound(p => p.id).Groupable(false);
        columns.Bound(p => p.FacultyName);
        columns.Bound(p => p.Subject);
        columns.Bound(p => p.University);
        columns.Bound(p => p.ContactNo);
    })

        .Groupable()
        .Sortable()
        .Pageable()
          .Scrollable()
        .Filterable()
         .ColumnMenu()
         .DataSource(dataSource => dataSource
            .Ajax()
          .PageSize(4)
            .Read(read => read
            .Action("Faculty_Read", "Faculty")
             )

        )
    ) 

The code of my controller is:

public ActionResult Faculty_Read([DataSourceRequest] DataSourceRequest request)
       {

           return Json(GetFaculty().ToDataSourceResult(request), JsonRequestBehavior.AllowGet);

       }


Please Inform me where may be i am wrong .I have also included all the kendo UI library with proper sequence as suggested in KendoUI documentation.

Thanks in advance!!!
Posted

Hi ,
After doing lot of R&D in Kendo UI i got that if we want sorting ,filtering and paging on client side we have to add .ServerOperation(false) so that all functionality like Sorting and filtering works on client side.
 
Share this answer
 
v2
Comments
Member 13926321 13-Aug-18 10:00am    
Wherer i have to add .ServerOperation(false) that means under which method?
Hi ,
After doing lot of R&D in Kendo UI i got that if we want sorting ,filtering and paging on client side we have to add .ServerOperation(false) so that all functionality like Sorting and filtering works on client side.
 
Share this answer
 
Comments
Sobitan 27-May-14 6:49am    
Hi Antariksh,
I just had the same problem where the filter was working on other grids on other pages but on one particular grid it had this problem and this solved it like a charm.
Thanks man u rock.
Antariksh Verma 27-May-14 6:54am    
Thanks a lot !!
Please click on accept answer!! :)
MohanDass17 4-Jun-14 3:48am    
How to add ServerOperation(false). Could you give a Sample code here ?
Antariksh Verma 4-Jun-14 5:38am    
Hi Mohan,

Please add .ServerOperation(false) after .PageSize(4)in above code !!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900