Skip to content
No description or website provided.
HTML C# CSS ASP
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.nuget
KendoGridBinder.Examples
KendoGridBinder
.gitignore updated nuget package, migrated to vs2012, and added some example rec…
KendoGridBinder.sln
readme.md

readme.md

Install

PM> Install-Package KendoGridBinder

Demo

http://kendogridbinder.apphb.com

Action Method

[HttpPost]
public JsonResult Grid(KendoGridRequest 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 KendoGrid<Employee>(request, employees);
    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: 'EmployeeId',
                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>
Something went wrong with that request. Please try again.