Unplanned
Last Updated: 30 Mar 2016 12:23 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 23 Sep 2015 11:11
Category: RichTextEditor
Type: Bug Report
0
FIX. RadRichTextEditor - TableCell.PreferredWidth property is not respected when a cell with ColumnSpan is available in the table
To reproduce: use the following code snippet and refer to the attached screenshot. Cells' width should be identical in both of the cases.

RadDocument document = new RadDocument();
Section section = new Section();
Table t = new Table();
t.Borders = new TableBorders(new Border(2, Telerik.WinForms.Documents.Model.BorderStyle.Single, Color.Black));
TableRow r1 = new TableRow();
TableCell cell = new TableCell();
Paragraph p = new Paragraph();
Span s = new Span();
s.Text = "Header";
cell.ColumnSpan = 3;
p.Inlines.Add(s);
cell.Blocks.Add(p);
cell.PreferredWidth = new TableWidthUnit(TableWidthUnitType.Percent, 100);
r1.Cells.Add(cell);

TableRow r2 = new TableRow();
TableCell cell11 = new TableCell();
Paragraph p11 = new Paragraph();
Span s11 = new Span();
s11.Text = "Cell1,1";
p11.Inlines.Add(s11);
cell11.Blocks.Add(p11);
cell11.PreferredWidth = new TableWidthUnit(TableWidthUnitType.Percent, 40);

TableCell cell12 = new TableCell();
Paragraph p12 = new Paragraph();
Span s12 = new Span();
s12.Text = "Cell1,2";
p12.Inlines.Add(s12);
cell12.Blocks.Add(p12);
cell12.PreferredWidth = new TableWidthUnit(TableWidthUnitType.Percent, 10);

TableCell cell13 = new TableCell();
Paragraph p13 = new Paragraph();
Span s13 = new Span();
s13.Text = "Cell1,3";
p13.Inlines.Add(s13);
cell13.Blocks.Add(p13);
cell13.PreferredWidth = new TableWidthUnit(TableWidthUnitType.Percent, 50);

r2.Cells.Add(cell11);
r2.Cells.Add(cell12);
r2.Cells.Add(cell13);
t.Rows.Add(r1);
t.Rows.Add(r2);
section.Blocks.Add(t);
document.Sections.Add(section);
this.radRichTextEditor1.Document = document;

Workaround: do not specify the PreferredWidth proeprty for cells with ColumnSpan>1
Attached Files:
0 comments