Unable to dynamically set the height of a Kendo grid under iOS

3 posts, 0 answers
  1. Randy
    Randy avatar
    75 posts
    Member since:
    Jul 2009

    Posted 31 Jan 2020 Link to this post

    I have the following code to dynamically set the height of a Kendo MVC grid. This works on any Windows based browser. However, it does not work in Chrome or Safari on an iOS device. Would you know why this isn't working? Or, is there a better way to change the height of a grid after it's been initialized?

     

    var grid = $("#grid").data("kendoGrid");
    $("#grid").css("height", 500);
    grid.resize()
    grid.redraw();
  2. Angel Petrov
    Admin
    Angel Petrov avatar
    1153 posts

    Posted 04 Feb 2020 Link to this post

    Hello Randy,

    The grid does not have a redraw method and thus when the last line is called a JavaScript error will occur. If it is being removed you should not experience any problems resizing the grid. I have tested the approach using this dojo and it seems to work. If you click the button above the grid it will get resized on iOS device.

    Regards,
    Angel Petrov
    Progress Telerik

    Get quickly onboarded and successful with your Telerik UI for ASP.NET MVC with the dedicated Virtual Classroom technical training, available to all active customers.
  3. Randy
    Randy avatar
    75 posts
    Member since:
    Jul 2009

    Posted 04 Feb 2020 in reply to Angel Petrov Link to this post

    Thank you. This does seem to work now.
Back to Top