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

Database notifications using signalr and E.F. to update Grid automatically.

4 Answers 489 Views
Grid
This is a migrated thread and some comments may be shown as answers.
martin
Top achievements
Rank 2
martin asked on 03 Feb 2015, 02:29 PM
Has anyone been able to use the kendo grid that will automatically update when something is changed in the database using signalr and Entity framework?
I have seen people using sqlDependency to do this but this doesn't work with entity framework? 

4 Answers, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 05 Feb 2015, 12:53 PM
Hello Martin,

You can check the SignalR example project, which illustrates how similar behavior could be achieved.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Pham
Top achievements
Rank 1
answered on 03 Jul 2019, 10:41 AM

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.

0
Tsvetomir
Telerik team
answered on 05 Jul 2019, 08:39 AM
Hi Pham,

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
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Franz
Top achievements
Rank 1
Iron
Iron
answered on 11 Jan 2024, 02:39 AM

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?

Georgi Denchev
Telerik team
commented on 12 Jan 2024, 01:53 PM

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

Tags
Grid
Asked by
martin
Top achievements
Rank 2
Answers by
Alexander Popov
Telerik team
Pham
Top achievements
Rank 1
Tsvetomir
Telerik team
Franz
Top achievements
Rank 1
Iron
Iron
Share this question
or