Dynamic resize of Gantt

6 posts, 0 answers
  1. Sam
    Sam avatar
    60 posts
    Member since:
    Mar 2011

    Posted 29 Oct 2014 Link to this post

    Just curious if anyone has figured a way to dynamically resize the Gannt chart on the client side. I've tried resizing the entire div container but it looks like I'd have to do every container inside the main div. Is there an easier way?
  2. Bozhidar
    Admin
    Bozhidar avatar
    1102 posts

    Posted 30 Oct 2014 Link to this post

    Hi,

    The Gantt control has a complex layout, where the inner containers have their sizes set depending on the available space determined by the outer container. This is all done in javascript. So in order to properly resize the control you have to:
    1. Set the size to the outermost container:
    $telerik.$($find("RadGantt1").get_element()).width(1000)
    2. Call the resize() method of the _widget object
    $find("RadGantt1").resize()


    Regards,
    Bozhidar
    Telerik
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sam
    Sam avatar
    60 posts
    Member since:
    Mar 2011

    Posted 30 Oct 2014 in reply to Bozhidar Link to this post

    Well it looks like that works for the outer borders and toolbar but the timeline view doesn't resize correctly. Sometimes it overflows outside the border, and sometimes it doesn't fill it up. See attached screen shots. 
  5. Sam
    Sam avatar
    60 posts
    Member since:
    Mar 2011

    Posted 30 Oct 2014 in reply to Sam Link to this post

    Bozhidar, sorry, but I'm actually getting an error calling the resize() function 

    "undefined is not a function"

  6. Bozhidar
    Admin
    Bozhidar avatar
    1102 posts

    Posted 30 Oct 2014 Link to this post

    Hi,

    Please excuse me. There's a type-o in the code sample I sent you. It should be:
    $find("RadGantt1")._widget.resize()


    Regards,
    Bozhidar
    Telerik
  7. Sam
    Sam avatar
    60 posts
    Member since:
    Mar 2011

    Posted 30 Oct 2014 Link to this post

    That worked perfectly. Thanks. 
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017