Integration with SignalR

3 posts, 0 answers
  1. Telerik Admin
    Telerik Admin avatar
    1572 posts
    Member since:
    Oct 2004

    Posted 30 Jan 2015 Link to this post

    Requirements

    Telerik Product and Version used

    Telerik Web UI for ASP.NET AJAX 2019.3.1023.45

    Supported Browsers and Platforms

    All browsers supported by Telerik UI for ASP .NET AJAX

    Components/Widgets used (JS frameworks, etc.)

    SignalR, ASP.NET, C#, JavaScript

    PROJECT DESCRIPTION 

    The sample illustrates how RadGrid can be integrated with SignalR so that the data on multiple clients is updated automatically.

    To test the functionality run the project and open the page in multiple browsers. When you change the data in RadGrid in one window, the data in other windows will be updated without a manual refresh.

  2. Lee
    Lee avatar
    2 posts
    Member since:
    May 2015

    Posted 18 Feb in reply to Telerik Admin Link to this post

    Hi,

     

    There is a flaw in the code.  

      $("[id*='SaveChangesButton']").click(function () {

    should actually be:

     $("[id*='SaveChangesIcon']").click(function () {

     

    The project caused me to scratch my head a lot until I figured this out 

  3. Attila Antal
    Admin
    Attila Antal avatar
    561 posts

    Posted 20 Feb Link to this post

    Hi Lee,

    Yes, the article was created a long time ago and there was only one RenderMode, the Classic. Today we have a modern one called Lightweight which renders different elements and sometimes different IDs or CSS classes. If you used the previous code and only change the RenderMode of the RadGrid to Classic, that would have fixed the issue, however, that RenderMode is old and outdated.

    To be on the safe side, you can make the JavaScript code work for both RenderModes by including both selectors:

    $("[id*='SaveChangesButton'],[id*='SaveChangesIcon']").click(function () {
        // Call the Send method on the hub. 
        dataPage.server.send();
    })

     

    Nevertheless, I have made some improvements to this Code Library sample. This no longer looks for the SaveChanges button or Icon, it uses other events to communicate with SignalR. Please download the new version and check it out.

     

    Kind regards,
    Attila Antal
    Progress Telerik

    Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers. Learn More.
Back to Top

This Code Library is part of the product documentation and subject to the respective product license agreement.