New to Telerik UI for ASP.NET MVC? Start a free 30-day trial

Custom DataSource

Updated on Oct 27, 2026

Telerik UI for ASP.NET MVC lets you use the CustomDataSource builder with helpers that support data binding.

The CustomDataSource builder class gives you full control over the DataSource client-side API options through Razor syntax. It lets you keep Telerik UI helper benefits—for example, generated validation attributes and editors—while still using JavaScript-level DataSource flexibility. You can also use the CustomDataSource builder in advanced scenarios where the regular DataSource builders limit full DataSource customization.

DataSource and Custom DataSource

Regular DataSource builders apply many default settings. The CustomDataSource builder removes these defaults, so when you declare a DataSource as custom, configure the required settings explicitly.

The following two examples demonstrate a regular Grid AjaxDataSourceBuilder and a CustomDataSource builder.

Razor
@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.OrderViewModel>()    
    .Name("grid")
    .Columns(columns => {
        columns.Bound(p => p.OrderID).Filterable(false).Width(100);
        columns.Bound(p => p.Freight).Width(100);
        columns.Bound(p => p.OrderDate).Format("{0:MM/dd/yyyy}").Width(140);
        columns.Bound(p => p.ShipName);
        columns.Bound(p => p.ShipCity).Width(150);
    })
    .HtmlAttributes(new { style = "height:430px;" })
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(20)
        .Read(read => read.Action("Orders_Read", "Grid"))
     )
)

The following example demonstrates a CustomDataSourceBuilder definition.

Razor
@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.ProductViewModel>()    
    .Name("Grid")    
    .Columns(columns => {        
        columns.Bound(p => p.ProductName);
        columns.Bound(p => p.UnitPrice).Width(140);
        columns.Bound(p => p.UnitsInStock).Width(140);
        columns.Bound(p => p.Discontinued).Width(100);
    })
    .DataSource(dataSource => dataSource        
        .Custom()         
        .PageSize(20)
        .Schema(schema => schema.Model(m => m.Id(p => p.ProductID)))
        .Transport(transport =>
        {
            transport.Read(read => read.Action("Orders_Read", "Grid"));
        })
    )
)

See Also