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

Bind Grid (and other components) to local datasource

1 Answer 192 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Victor
Top achievements
Rank 1
Victor asked on 08 Jan 2013, 07:04 PM
Hi!
(see edit - base questions fixed)

After implementing the grid for some of our core object listings using a combination of server-side and ajax databindings we have realized we would like to speed up the grid sorting/filtering/searching as well as implementing some more advanced scenarios.

After some reasoning we came up with the idea to use a local datasource and to manipulate evering in memory. However we couldnt find a straight-forward way of doing this. We expected something like:

@(Html.Kendo().Grid(Model.GridRows)
   //...
       .DataSource(dataSource =>
                        {
                            dataSource.Local()
                                .Model(model => model.Id(s => s.Id))
                                .Sort(sort => sort.Add(s => s.Name));
                        })
)

However we realize it would be problematic to do CRUD operations using this approach - for that we would prefer to be able to use Ajax.

So - hopefully I have explained the idea reasonably well. Basically:
  • Is there any good way to use a local datasource (custom js-driven supporting filtering etc)? 
  • Is there any good way to take direct control of the datasource (like @Html.DataSource().... and use that is some way)?

Edit: We realized we could use dataSource.Ajax().ServerOperation(false) to achieve the base behaviour. We can probably figure out how to do some advanced filtering using the Web demos. The second point we still wonder about though - is it possible to use the datasource more directly? For example using a shared datasource or doing some more custom refreshing scenarios without resorting to an all-javascript approach?

Thanks
/Victor

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 10 Jan 2013, 03:18 PM
Hi Victor,

 Currently there is no way to create a Kendo DataSource from C#. Every data bound widget which has an ASP.NET MVC wrapper has its own data source. 

 As far as I understand your needs an Ajax data source with disabled server operations would be the best option.

Regards,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Victor
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or