Table columns - fit content and page width

2 posts, 0 answers
  1. Simon
    Simon avatar
    57 posts
    Member since:
    May 2008

    Posted 08 Oct Link to this post

    Hi,

    We have a table with static column widths for all columns but one. We calculate the width for the Description column so that the table width is 100% of the containing page. We are using the following binding for the Description column:

    Width  =WidthForDescriptionColumn(Fields.BillableSection)

    where WidthForDescriptionColumn simply subtracts predefined column widths from the page width based on their visibility.

    One of our customers complained that they use large numbers (like 8 digits + 2 decimal) and they get wrapped in the column. We decided to implement dynamic column widths for some columns using an approach mentioned at https://www.telerik.com/forums/auto-size-for-textbox#6rdYCe6DPUygy_EmqRM5sg . It did work, however since WidthForDescriptionColumn still returned a static value, the rightmost column got pushed beyond page edge.

    The question is, is there a simpler way of achieving the following scenario:

    1. Some table columns should have static width.

    2. Some table columns should have dynamic width based on its content (actually something like min-width).

    3. One of table columns should have dynamic width which is calculated so that the table width would be 100% of the containing page.

    Thanks.

  2. Nasko
    Admin
    Nasko avatar
    1070 posts

    Posted 11 Oct Link to this post

    Hi Simon,

    Once a column of the table is increased in size using the mentioned bindings approach, you will need to make sure that another column (or all other columns) is decreased in size by the same amount, so the whole table does not grow outside the bounds of the page.

    We do not have an out-of-the-box autosize feature implemented at the moment and there is no easier way to achieve the scenario. You can request such feature in our Ideas & Feedback portal.

    Regards,
    Nasko
    Progress Telerik

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top