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

How to force an update to the Grid and display a Notification when the DataSource changes

1 Answer 665 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jim
Top achievements
Rank 1
Jim asked on 12 Jun 2018, 04:09 PM

I am using the Telerik Grid on a dashboard-type of web page in ASP.NET Core 2.1 (with Razor pages). I need to have the contents of the Grid updated when the data presented in the Grid changes. In case there are better solutions, I will give a bit more detail.

I have 2 web apps. One, let's call it the child web app, will send a notification via SignalR to the main web app, called the parent. When the parent app receives the notification via SignalR I want to update the Telerik Grid as well as display the message contained in the SignalR notification in a Telerik Notification. 

I know that I can use SignalR directly with the Grid, but I don't see any way to preserve the data that arrives via SignalR.  I need to save the data that arrives in the SignalR message.

So, I need to do this:

1. Force the Grid to re-read and display the data when the web app receives a SignalR notification.

2. At the same time display a Telerik Notification.

Again, this is in an ASP.NET Core web app with Razor pages using .NET Core 2.1

 

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 15 Jun 2018, 06:02 AM
Hello Jim,

If the Grid is using AJAX binding, when you receive the notification you can call the "read" method of the Grid's DataSource, which will make another request to get the new data:
$("#yourGridID").getKendoGrid().dataSource.read();

As for the notification, you can use the "show" method either before or after calling the "read" method of the DataSource:
Hope this helps.


Regards,
Konstantin Dikov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Jim
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or