This is a migrated thread and some comments may be shown as answers.

Table columns - fit content and page width

1 Answer 929 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 08 Oct 2019, 09:19 PM

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.

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 11 Oct 2019, 11:14 AM

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
Tags
General Discussions
Asked by
Simon
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Share this question
or