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

[Solved] Client Side Event after all onRowDataBound have fired

2 Answers 146 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Alan Murphy
Top achievements
Rank 1
Alan Murphy asked on 26 Jan 2010, 07:37 PM
I am currently using an Ajax grid with the following client side events.
  •  .OnRowDataBound("onRowDataBound")
  •  .OnLoad("onLoad")
  •  .OnDataBinding("onDataBinding")

When i manually call grid.rebind in JavaScript I display my own UI blocking screen.  Within the OnRowDataBound I manipulate the html of the grid cells.  After all of the rows have been bound, or possibly 0, I need to be able to hook into some event, so I can remove my UI blocking screen from being displayed.  Are there any other client side events that I can hook into, such as gridIsReady?



      2 Answers, 1 is accepted

      Sort by
      0
      Accepted
      Atanas Korchev
      Telerik team
      answered on 27 Jan 2010, 09:21 AM
      Hello Alan Murphy,

      Currently there is no such event. However it is a very good idea to have a OnDataBound event for scenarios like yours. I have logged this as a feature request and we will implement it right away.

      As a workaround you can use the following code:

      <% Html.Telerik().ScriptRegistrar().OnDocumentReady(() =>
             {
                 %>
                  $.telerik.grid.prototype.dataBind = function(data) {
                      this.bindTo(data);
                      this.updatePager();
                      this.updateSorting();
                      //Call your code here
                  }
                 <%
              }); %>

      It will override the grid's dataBind method and will call your code after the grid has been bound.

      Regards,
      Atanas Korchev
      the Telerik team

      Instantly find answers to your questions on the new Telerik Support Portal.
      Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
      0
      Alan Murphy
      Top achievements
      Rank 1
      answered on 27 Jan 2010, 11:54 AM
      Workaround works great.  Thanks for the help.

      Alan Murphy
      Tags
      Grid
      Asked by
      Alan Murphy
      Top achievements
      Rank 1
      Answers by
      Atanas Korchev
      Telerik team
      Alan Murphy
      Top achievements
      Rank 1
      Share this question
      or