I have seen people using sqlDependency to do this but this doesn't work with entity framework?
4 Answers, 1 is accepted
You can check the SignalR example project, which illustrates how similar behavior could be achieved.
Regards,
Alexander Popov
Telerik
Hi Martin,
I have sample problem. Have you any idea ?
(I need insert from other application, and I want change automatic, and I don't want sqlDependency because database is large).
Thanks.
The Kendo UI Grid can be bound to a SignalR data source. We have created a live demo which demonstrates how this could be achieved. It uses Hubs which transfer the data. More information could be found here:
https://demos.telerik.com/kendo-ui/grid/signalr
The implementation of the Hubs that this grid is using are public. The full implementation of the service could be found here:
https://github.com/telerik/kendo-ui-demos-service/blob/master/signalr-hubs/signalr-for-aspnet-core/Hubs/ProductHub.cs#L24-L46
In the current scenario the Hubs work with IEnumerable collections. In the current case those collections are derived from an SQL DataTable. However, according to your preference, you can obtain the collection without SQL. Therefore, you would not have any dependencies for the SQL.
Let me know in case additional questions arise.
Kind regards,
Tsvetomir
Progress Telerik
Hello,
I am using SignalR on my Kendo grid. When client does a change from web, it works but if i do some changes in the database for some records it doesn't refresh the Grid so I need to refresh manually the page. Is there a way to refresh automatically when there is a change on Database? Is there an example that uses sqldependency or any other method?
Hi, Franz,
The Grid will update itself whenever it receives a push notification from the server. So what you need to figure out in this case is how to send a notification to the clients from the service itself, instead of receiving a message from one client and sending it to the other.
Using the Hub from the previous reply, you'll have to find a way to detect a change and then update the clients with the corresponding information:
Clients.OthersInGroup(GetGroupName()).SendAsync("update", entity);
Best Regards,
Georgi