1
votes

I have a kendo data grid which is bind with ASP.NET ajax binding. When ever I press grid refresh icon, or do a sort or filtering it will update the grid with current values from database. But I want it get updated automatically when the database get updated or in other words (when the related datasource updated, but I don't know how to trigger that change in datasource).

Also, I don't want to have a timer and refresh the grid based on some time intervals, I just want it get updated when the related data changed.

Thanks in advance!

1

1 Answers

4
votes

The grid will update automatically when the underlying dataSource is updated.

The problem is updating the underlying dataSource without any client-side action to trigger a re-read from the server.

Since this is the web, the dataSource is not directly connected to the server and any changes on the server will not be reflected in the dataSource as the server has no access to the client-side dataSource.

So, you need to use an additional technology/technique that provides this type of connection.

Take a look at Kendo's SignalR integration demo to see if it serves your needs.
http://demos.telerik.com/aspnet-mvc/grid/signalr

Otherwise, you can research "long polling" and/or websockets to see if they meets your needs better.