Skip to content

MyoMinLin/KendoGridBinderEx

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#KendoGridBinderEx

Build status

Install

PM> Install-Package KendoGridBinderEx

Supported dotnet versions

  • .net 4.5
  • .net 4.5.x

Demo

http://kendogridbinderex.apphb.com

Action Method

[HttpPost]
public JsonResult Grid(KendoGridMvcRequest request)
{
    var employees = new List<Employee>
    {
        new Employee { EmployeeId = 1, FirstName = "Bill", LastName = "Jones", Email = "bill@email.com" },
        new Employee { EmployeeId = 2, FirstName = "Rob", LastName = "Johnson", Email = "rob@email.com" },
        new Employee { EmployeeId = 3, FirstName = "Jane", LastName = "Smith", Email = "jane@email.com" },
    };

    var grid = new KendoGridEx<Employee, EmployeeVM>(request, employees.AsQueryable());
    return Json(grid);
}

HTML

<div id="grid"></div>

Script

<script>
    var url = '@Url.Action("Grid")';

    var dataSource = new kendo.data.DataSource({
        serverPaging: true,
        serverSorting: true,
        serverFiltering: true,
        pageSize: 20,
        transport: {
            read: {
                type: 'post',
                dataType: 'json',
                url: url
            }
        },
        schema: {
            data: 'Data',
            total: 'Total',
            model: {
                id: 'Id',
                fields: {
                    FirstName: { type: 'string' },
                    LastName: { type: 'string' },
                    Email: { type: 'string' }
                }
            }
        }
    });

    $('#grid').kendoGrid({
        dataSource: dataSource,
        height: 400,
        columns: [
            { field: 'FirstName', title: 'First Name' },
            { field: 'LastName', title: 'Last Name' },
            { field: 'Email' }
        ],        
        filterable: true,
        sortable: true,
        pageable: true
    });
</script>

About

KendoGridBinderEx

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 52.7%
  • HTML 32.8%
  • JavaScript 8.3%
  • CSS 6.2%