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

Auto-height for textbox?

8 Answers 374 Views
Input
This is a migrated thread and some comments may be shown as answers.
xws-mika
Top achievements
Rank 1
xws-mika asked on 10 Sep 2008, 09:18 AM

Is there a way to set the height of a multi-row textbox so that it automatically shows it's complete content without scrollbars, but also without unnecessary white space at the bottom?

Reason: I have a page which can be in edit or in read-only mode. In read-only mode, I'd like for all input controls to show their complete content, regardless of the amount of text (e. g. for printing). Is this possible?

8 Answers, 1 is accepted

Sort by
0
Missing User
answered on 10 Sep 2008, 10:35 AM
Hello xws-mika,


You can use the Rows property to specify the number of rows displayed in a multiline RadTextBox control -
review the following help article:
http://www.telerik.com/help/aspnet-ajax/telerik.web.ui-telerik.web.ui.radtextbox-rows.html

Best wishes,
Plamen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
xws-mika
Top achievements
Rank 1
answered on 10 Sep 2008, 11:07 AM

Thanks for the quick response, Plamen! Well, I know the Rows property, but I don't know in advance how long the text in the textbox will be (depends on user entry), so I don't know in advance how many rows the textbox will need.
 
The point is that I want the textbox to be EXACTLY as high as required when the page is in read-only mode (in edit mode the height doen't matter). So it seems that I have to count the characters in the textbox and set the number of rows dynamically.

Disadvantage of this approach: the calculated number of rows can only be an estimation, especially because Internet Explorer breaks the line after a hyphen, but Firefox doesn't.

So I'm still hoping that the radTextbox has some kind of built-in feature for that purpose...

0
Accepted
Missing User
answered on 11 Sep 2008, 07:58 AM
Hello xws-mika,


Currently, RadInput control does not support the requested functionality. Your request has been logged in our ToDo list for future consideration.

Kind regards,
Plamen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Grendizer
Top achievements
Rank 1
answered on 21 Oct 2008, 10:19 AM
Hello Plamen,

Is there any news concerning this feature ?!

Thanks in advance for your answer.
0
Missing User
answered on 24 Oct 2008, 10:01 AM
Hello Grendizer,


Unfortunately, such feature will be very hard to be implemented and I doubt you will see it soon in the control. Anyway, your request has been logged in our ToDo list for future consideration. I will also appreciate if you provide links to online resources/other vendors which have this type of functionality included in their input controls. Thus we can research the matter in detail and eventually change our plans for future development.

All the best,
Plamen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Grendizer
Top achievements
Rank 1
answered on 24 Oct 2008, 10:17 AM
Thanks for your answer.
0
Vamshi
Top achievements
Rank 1
answered on 18 Nov 2014, 05:44 PM
Hi,

I have a similar need now. Considering the last discussion on this was 6 years ago, I am hoping something is now available/possible for the textbox control. Is there?

Thanks!
0
Viktor Tachev
Telerik team
answered on 21 Nov 2014, 11:40 AM
Hi,

Automatically changing the height of a RadTextBox control is not available out of the box. However, you could achieve this functionality with little JavaScript. Try using the approach suggested in this forum post.

Regards,
Viktor Tachev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Input
Asked by
xws-mika
Top achievements
Rank 1
Answers by
Missing User
xws-mika
Top achievements
Rank 1
Grendizer
Top achievements
Rank 1
Vamshi
Top achievements
Rank 1
Viktor Tachev
Telerik team
Share this question
or