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

TextBox auto size

3 Answers 480 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
JC Wu
Top achievements
Rank 1
JC Wu asked on 09 Dec 2011, 03:25 AM
Hi, I want to set a TextBox auto-size.
I know it can be done by using Binding property and user function.
But I also need to serialize this report to xml.
Width.Value is readonly, so I cannot set it's width without using user function.
Is there any other way to do this?

3 Answers, 1 is accepted

Sort by
0
Elian
Telerik team
answered on 09 Dec 2011, 05:53 PM
Hello Jc Wu,

You can do it with binding. In order the user function to work properly you have to deserialize the report from xml by using the report type that contains the user function. I have attached a sample project that has the functionality.

Kind regards,
Elian
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

0
Satish
Top achievements
Rank 1
answered on 21 Aug 2012, 07:20 AM
HI,
     I am getting data dynamically and  have to assign to textbox.My question is how to resize the texbox as per content in DB.

For example: data is 10 characters but that textbox holds 6 characters ,but when  displaying it should show 10 characters .How to achieve this.

regards,
sateesh
0
Elian
Telerik team
answered on 21 Aug 2012, 07:06 PM
Hi Satish,

You can bind the Width property of the textbox to a user function which will calculate and return the size according to the input. This, however, will be a hard thing to accomplish because of the many factors which determine the text length, like font family, font size, font decoration, etc. 

All the best,
Elian
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

Tags
General Discussions
Asked by
JC Wu
Top achievements
Rank 1
Answers by
Elian
Telerik team
Satish
Top achievements
Rank 1
Share this question
or