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

Local data binding with update.

3 Answers 385 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Xavier
Top achievements
Rank 1
Xavier asked on 19 Sep 2014, 10:36 PM
I only need to show a few rows (say 5 -100) in my grid so I rather use local binding.  But I need to use inline edit on a date column.
How do I go about doing this?

The current solution/examples uses ajax to read the data. I could take that approach and it would result in one extra unnecessary request. The bigger problem is, the query to read the data is a bit complex so I am using Native SQL and I am not sure how to mix that in with Kendo's DataSourceRequest.
My current code which I know is wrong when it comes to pagination.
var enterpriseAccounts = db.Database.SqlQuery<EnterpriseAccountsVM>(enterpriseAccountsQuery, new SqlParameter("accountType", AccountType.Enterprise)).ToList();
return Json(enterpriseAccounts.ToDataSourceResult(request));

I could solve all my problems by using client side pagination but have updates call the server. Is this possible?

3 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 23 Sep 2014, 12:53 PM
Hello,

You can pass the data to the GridBuilder:
Html.Kendo().Grid(Model)
and enabled client-side operations with the DataSource ServerOperation method. No read request will be required and the paging, filtering, etc. will be performed on the client but a request will still be sent for updates.

Regards,
Daniel
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Xavier
Top achievements
Rank 1
answered on 23 Sep 2014, 06:32 PM
I tried
​@model IEnumerable<AccountsPaymentDueKendoVM>
@(Html.Kendo().Grid(Model)

but it gives error

The best overloaded method match for 'Kendo.Mvc.UI.Fluent.WidgetFactory.Grid(System.Data.DataView)' has some invalid arguments

0
Xavier
Top achievements
Rank 1
answered on 23 Sep 2014, 06:48 PM
I copied from the sample
VS2013\Kendo.Mvc.Examples\Areas\razor\Views\grid\local_data_binding.cshtml

and it works now
@model IEnumerable<AccountsPaymentDueKendoVM>
 @(Html.Kendo().Grid(Model)

Tags
Grid
Asked by
Xavier
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Xavier
Top achievements
Rank 1
Share this question
or