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

How do I auto-size-locate textbox

2 Answers 217 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Wadigzon
Top achievements
Rank 1
Wadigzon asked on 01 Aug 2013, 12:37 AM
I have the following scenario:

in one line I have, textbox1, textbox2, and textbox3

textbox2 will always be the separator ">" (constant width)

textbox1 and textbox3 will come from a data source, given that I set up the width of textbox1 and textbox3 as a fixed value with the
mouse in design mode. There will always be empty spaces (when text is shorter) or text cut out (when text is longer), texbox1 is
left justified, textbox3 is right justified. I would like avoid empty spaces in between and put the nicely text on the report whatever the value of the data is. This implies setting the width of textbox1 and textbox3 dynamically to account for the amount of text in the incoming data. and probably also changing the location X value of the text so that text appears one next to the other ( I would like to avoid empty spaces as much as possible)

regards,

2 Answers, 1 is accepted

Sort by
0
Accepted
Elian
Telerik team
answered on 05 Aug 2013, 02:43 PM
Hello,

There aren't any mechanisms provided in Telerik Reporting that would allow the textboxes to adjust to the width of the text. However, you can build your own custom logic implementing this scenario. 
Please take a look at the following thread, elaborating on your case: 
Auto size for textbox

Another thing you can do is use only one TextBox, instead of 3. Its expression will look like the following:
=Fields.Field1 + " > " + Fields.Field2. This way, you can control the spacing. In this scenario, however, you will lose the ability to align right the text in textBox3. 

Regards,
Elian
Telerik

Have you tried the new visualization options in Telerik Reporting Q2 2013? You can get them from your account.

0
Wadigzon
Top achievements
Rank 1
answered on 05 Aug 2013, 04:22 PM
Yes. My solution was to just have one field in design mode, and do text concatenation in the background. I can live with this.
Tags
General Discussions
Asked by
Wadigzon
Top achievements
Rank 1
Answers by
Elian
Telerik team
Wadigzon
Top achievements
Rank 1
Share this question
or