Autosize LayoutControls

4 posts, 0 answers
  1. Andreas Haeusler
    Andreas Haeusler avatar
    25 posts
    Member since:
    Nov 2009

    Posted 16 Nov 2015 Link to this post

    Hello,

     

    is there a way to enable autosizing on LayoutControls or LayoutGroupControls?

    The designer shows Autosize and even AutosizeMode properties, but they dont seem to be working... I'm trying to add a radgridview to a LayoutGroup. The grid is going to show different amounts of rows ​thus having a variable height. I would like the surroundind LayoutGroupControl to wrap around the grid and match its height accordingly.

     

    Kind regards,

    Andreas

     

     

     

     

     

  2. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 17 Nov 2015 Link to this post

    Hello Andreas,

    Thank you for writing.

    The items in the layout control do not have AutoSize functionality. In fact, what you need should be achieved, by controlling the item height, which will size the grid, not the other way around. 

    The group item hosts LayoutControlItem and you can set its MinSize/MaxSize properties to control its size. Once the item size is changed, it will change the inner grid size as well:
    layoutControlItem1.MaxSize = new Size(0, 60);

    Please give this approach a try and let me know how it works for you.

    Regards,
    Stefan
    Telerik

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Andreas Haeusler
    Andreas Haeusler avatar
    25 posts
    Member since:
    Nov 2009

    Posted 17 Nov 2015 in reply to Stefan Link to this post

    Hello Stefan,

     

    changing the layoutControlItem.Size to match the space requirements of the embedded RadGrid seems rather difficult to me. The size of the grid can change at runtime (different parameters for a query, manual resizing of rows/columns), the position and depth in the element tree could be changed by the end user (via the customize dialogs) -- i suppose in a nested layout i would have to propagate the size changes up to other parent containers as well? Sounds terrifying!

     

    It really should work like in a tablelayoutpanel with autosize rows/columns -- the innermost controls decide the rows/columns size and therefore the tablelayouts size (constrained by maxsize or available space in parent container).

     

    Kind regards,

    Andreas

  5. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 17 Nov 2015 Link to this post

    Hi Andreas,

    Indeed, such feature would be useful, so I added it to our feedback portal, where users can vote for it and track its status: http://feedback.telerik.com/Project/154/Feedback/Details/175482-add-radlistcontrol-add-support-for-autosize-of-layoutcontrolitem.

    I have updated your Telerik points for this request.

    Should you have any other questions or suggestions, do not hesitate to contact us.

    Regards,
    Stefan
    Telerik

Back to Top