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

[Solved] How to bind to DataTable when Controller is Returning GridModel

0 Answers 25 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
saurabh
Top achievements
Rank 1
saurabh asked on 11 Jul 2011, 01:04 AM

Model:

 

[

 

OperationContract]

 

 

 

public GridModel GetSalesOrders(GridState state)

 

{

 

 

return new DBHelper().ExecuteSql(Settings.Default.SalesOrderSelectSql, state);

 

}

View:

 

@(Html.Telerik().Grid<System.Data.

 

DataRow>()

 

.Name(

 

"SalesOrders")

 

.DataKeys(dataKeys => dataKeys.Add(

 

"OrderId"))

 

.Columns(columns =>

{

columns.Bound(

 

typeof(int), "OrderId").Width(100);

 

columns.Bound(

 

typeof(string), "CustomerName").Width(200);

 

columns.Bound(

 

typeof(string), "CustomerEmail");

 

})

.DataBinding(dataBinding => dataBinding.WebService().Select(

 

"~/Models/DataServices.svc/GetSalesOrders"))

 

.Pageable()

)

Controller:

 

public

 

 

ActionResult Index() {

 

 

 

return View();

 

}

Problem:
It says problem id - 12152

This is my first attempt towards using MVC Telerik Grid, so I might be doing something really silly..

Any help?

Tags
Grid
Asked by
saurabh
Top achievements
Rank 1
Share this question
or