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

Textboxes Don't Grow

2 Answers 308 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 28 Oct 2011, 05:26 PM
I have a subreport that looks like this:

Fields.AuthorName    Fields.Subject
                                  Fields.Note
                                  Created: Fields.CreateDate        Last updated: Fields.LastUpdated

I would like the textbox holding Fields.Subject and Fields.Note to grow as necessary and push the CreateDate and LastUpdated and their labels down the page.  Right now I am concentrating on the Note field.  Note has CanGrow, TextWrap, and Multiline set to True.
 
When there are multiple lines in the Note, only 2 lines show, the rest are cut off.  I have tried setting the Anchor property on Note to Top, Bottom, Left, Right and the Anchor property on the CreateDate and LastUpdated fields and their labels to Bottom, but this doesn't seem to do much.

I also tried putting the AuthorName and Subject fields in a group header and the CreateDate and LastUpdated fields in a group footer so that the Note field is the only thing in the detail section.  I tried this both with and withoutt the Anchor property on Note set.  The behavior is the same, even though there isn't even anything in the section for the Note textbox to push against.

It seems like what I am looking to do should be possible, but I haven't found much help with this in my searches on the site.  Does anyone know how to get a textbox to grow and push down what's below it?

2 Answers, 1 is accepted

Sort by
0
Accepted
Steve
Telerik team
answered on 02 Nov 2011, 04:33 PM
Hello Brian,

CanGrow, TextWrap, and Multiline properties are True by default and this allows the TextBox to grow vertically unconditionally. Anyway we would expect a runnable sample in your support thread so we can reproduce this on our end.

Greetings,
Steve
the Telerik team

Q2’11 SP1 of Telerik Reporting is available for download (see what's new). Get it today.

0
Brian
Top achievements
Rank 1
answered on 07 Nov 2011, 03:46 PM

Thanks to Steve's help, I have solved this problem with my report.

The problem was that Silverlight was using \r (line feed) as its newline character when I entered a return in a TextBox.  Telerik Reporting expects newlines to be \n or \r\n, so the textbox on my report was not growing properly.

This was fixed by adding a User Function to my report that is like this:

public static object ReplaceLineCharacters(string value)
{
    return value.Replace("\r", "\r\n");
}

Instead of the usual =Fields.Note as the Value property of the textbox on my report, it is now =ReplaceLineCharacters(Fields.Note)

The textboxes on my report now grow properly.
Tags
General Discussions
Asked by
Brian
Top achievements
Rank 1
Answers by
Steve
Telerik team
Brian
Top achievements
Rank 1
Share this question
or