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

CanGrow property not working properly

1 Answer 186 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chetan
Top achievements
Rank 1
Chetan asked on 13 Dec 2013, 05:17 AM
I am using following code to Create New cell for Detail Header

            using (var cell = new TextBox())
            {
                cell.Value = value.GetRenderingFormat();
                cell.StyleName = styleSheetKey.ToString();
                cell.Size = new SizeU(GetColumnWidth(isFirstColumn), GetRowHeight());
                cell.TextWrap = true;
                cell.Multiline = true;
                cell.KeepTogether = false;
                cell.CanGrow = true;
                return cell;
            }
        }

But the result is strange... for specific width that can adjust in 3 line works fine but not for 4 line. At the same time the column beside this one is working fine. The diff. between content is only one character is getting wrap in case of invalid printing.

Padding of the cell in stylesheet is as follwoing:

  <BorderStyle Bottom="Solid" Top="Solid"/>
      <BorderColor Default="Gray" />
      <BorderWidth Bottom="0.5pt" Top="0.5pt"/>
      <Font Name="Arial" Size="8pt" Bold="True" />
      <Padding Left="0.19cm" Right="0.2"/>

Please see attached screens.

1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 17 Dec 2013, 04:22 PM
Hi Chetan,

In browsers the browser's layout engine determines how elements are rendered. Try using different font, decreasing the font size and increasing the item's width. You can test also using a Table item without set DataSource having single row in which you can place the desired values. This approach will assure the items size according to each other.

Whenever you need to create dynamically a report, start by creating a simple report using the report designer, which has also preview options to check the result document. Finally reuse the generated in the designer.cs code.

If you need further help, please open a support ticket and send us a runnable sample project illustrating the problem and details about the rendering media.

Regards,
Stef
Telerik

New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

Tags
General Discussions
Asked by
Chetan
Top achievements
Rank 1
Answers by
Stef
Telerik team
Share this question
or