Unable to resize grid. Error: Unable to get property 'GridDataDiv' of undefined or null reference

3 posts, 0 answers
  1. Sal
    Sal avatar
    2 posts
    Member since:
    Jun 2012

    Posted 07 May 2015 Link to this post

    I have been using the follow code ( trimmed and cleaned for posting ) to resize the scrolling part of the div depending on how tall the browser is. After upgrading form Q3 2014 to Q1 2015 this error has started to be thrown. Thoughts?

    01.function ResizeReviewersGrid() {
    02.            if ($find("grid_id")) {
    03. 
    04.                var grid = $find("grid_id");
    05. 
    06.                if (grid.GridDataDiv) {
    07. 
    08.                    var scrollArea = grid.GridDataDiv;
    09.                    var gridHeader = grid.GridHeaderDiv;
    10. 
    11.                    scrollArea.style.height = 500 - gridHeader.clientHeight + "px";
    12. 
    13.                    grid.repaint();
    14.                }
    15.            }
    16.        }

  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 12 May 2015 Link to this post

    Hi Sal,

    Note that the mentioned GridDataDiv is only rendered when the RadGrid's StaticHeaders are enabled. Please make sure that you have enabled static headers and see how it goes.

    Regards,
    Maria Ilieva
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 12 May 2015 Link to this post

    Hi,

    Also please try to access the RadGrid like that:
    var grid = $find(<%=grid_id.ClientID%>)


    Regards,
    Maria Ilieva
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top