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

Remote Databinding

2 Answers 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
gsharp
Top achievements
Rank 1
gsharp asked on 01 Jun 2015, 07:18 AM

Hi

 Is it possible to implement Remote DataBinding for a Grid, but with the difference that when the View is rendered the Data for the first Grid-Page is also already rendered (and not loaded afterwards async) ?

 Many thanks

Giuseppe

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay Rusev
Telerik team
answered on 03 Jun 2015, 06:18 AM

Hello gsharp,

You can set the initially the data for the Grid:

/the view/

@model IEnumerable<Kendo.Mvc.Examples.Models.OrderViewModel>

@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.OrderViewModel>(Model)    
    .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);
    })
    .Pageable()
    .Sortable()
    .Scrollable()
    .Filterable()
    .HtmlAttributes(new { style = "height:430px;" })
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(20)
        .Read(read => read.Action("Orders_Read", "Grid"))
     )
)

/the controller to that view/

 public partial class GridController : Controller
    {
        public ActionResult Remote_Data_Binding()
        {
            return View(GetOrders())
        }
    }

Regards,
Nikolay Rusev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
gsharp
Top achievements
Rank 1
answered on 03 Jun 2015, 11:14 AM
awesome!!
Tags
Grid
Asked by
gsharp
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
gsharp
Top achievements
Rank 1
Share this question
or