Our second installation of “Kendo UI DevChat” has come and gone! Time flies when you are having fun. This second session was about the Kendo UI DataSource and how it makes it dead simple to connect Kendo UI Widgets to both local and online data sources. In particular, we had the chance to take a look at a Kendo UI Grid and a Kendo UI Chart both bound to the same data array. Any methods invoked on the DataSource would graphically be reflected on the UI widgets bound to it. Furthermore, we had the chance to implement full CRUD operations on the Kendo UI Grid via a ASP.NET CORE backend.
Here you can find the online dojo we worked on for the first part and here’s the Github project with the asp.net core website we used as backend for the second half of the demo. And you can check out the recording of the whole chat below.
As usual we received great feedback from you in the form of interesting, thought-provoking questions!
Questions and Answers
Can I bind a DataSource to a local array?
Certainly! Please see our demo on Local Data Operations on the Kendo UI DataSource.
Is there a limit of maximum data that the DataSource can hold?
There is no set limit. The DataSource has a first-class concept of Pagination, which is the recommended approach to take when you are expecting to deal with large amounts of data.
How can I handle Master-Detail Scenarios?
Since these scenarios usually require that the Child Grid display different (although related) data from the initial DataSource, it is recommended that the child Grid have its own DataSource filtered by a key value from the parent. Please see our Kendo UI Grid hierarchy sample for an example of this.
Can I change the data in the DataSource programatically?
Definitely, the Kendo UI DataSource has a sync method that will push/confirm any changes to the underlying data in the DataSource.
I have a local array -> I bind 2 grids to it -> I change the array -> will the grids get notified about the change?
The grids will not be notified. The recommended approach is to use the DataSource API to make the changes to the data. Please see this sample
What is @section <scripts>
This is a Razor feature that allows a razor file specify the place where the body of the section should be put when merging with the Layout file.
If you set up pagination for your DataSource and you have a chart sharing that DataSource, will the chart only show information relevant to that current page of data?
Correct, with this set-up the chart will always remain in sync with the current view of the DataSource.