What is the correct way to programmatically specify a required width for a TableCell in a Table?
I'm trying:
and:
and:
but neither has any effect on the resulting table where the columns are created too wide and don't fit into my document.
Also, is there any way to restrict the maximum width of a table row so that it always fits into the document and it's columns are spread evenly?
Help!
I'm trying:
cell.PreferredWidth = new TableWidthUnit(TableWidthUnitType.Fixed, (float)120);
cell.PreferredWidth = new TableWidthUnit(TableWidthUnitType.Percent, (float)20);
cell.PreferredWidth = new TableWidthUnit(TableWidthUnitType.Percent, (float)0.2);
Also, is there any way to restrict the maximum width of a table row so that it always fits into the document and it's columns are spread evenly?
Help!
5 Answers, 1 is accepted
0
Hello Aggie,
The property you're currently using is the correct one, however, there are some details about it. First of all, the width conflict resolution policy is to use the width of the first cell in a column with an explicit one set. If you have other cells above the one you're modifying that have PreferredWidth set, those will be used.
Secondly, this gets even more complicated due to the fact that a cell can span more than one column. To make these situations easier to manage, you have Table.Grid.Columns at your disposable where you can set the preferred widths on a per-column level.
Best wishes,
Ivailo
the Telerik team
The property you're currently using is the correct one, however, there are some details about it. First of all, the width conflict resolution policy is to use the width of the first cell in a column with an explicit one set. If you have other cells above the one you're modifying that have PreferredWidth set, those will be used.
Secondly, this gets even more complicated due to the fact that a cell can span more than one column. To make these situations easier to manage, you have Table.Grid.Columns at your disposable where you can set the preferred widths on a per-column level.
Best wishes,
Ivailo
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0

Ikhwan
Top achievements
Rank 1
answered on 25 May 2011, 12:42 PM
When you say its easier to set width using Table.Grid, how is this been done?
0
Hi Ikhwan,
Please refer to your support ticket with ID 422542 for an answer with the appropriate demo.
Let us know if you need any further assistance.
Regards,
Ivailo
the Telerik team
Please refer to your support ticket with ID 422542 for an answer with the appropriate demo.
Let us know if you need any further assistance.
Regards,
Ivailo
the Telerik team
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 Public Issue Tracking
system and vote to affect the priority of the items
0

Ikhwan
Top achievements
Rank 1
answered on 03 Jun 2011, 01:08 PM
I've seen the demo / project file you gave me but that is for the same width for each column. I need an example that involves ColumnSpan and different width for each column.
0
Hello Ikhwan,
Iva
the Telerik team
You can find another demo attached in the support ticket Ivailo cited. If you have other comments, please share them in the ticket thread and we will do our best to address them as soon as possible.
Best wishes,Iva
the Telerik team
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 Public Issue Tracking
system and vote to affect the priority of the items