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

WatermarkTextBox Width Grow

3 Answers 275 Views
WatermarkTextBox
This is a migrated thread and some comments may be shown as answers.
gerardo
Top achievements
Rank 1
Veteran
gerardo asked on 23 Jul 2020, 01:42 PM

Good day.

I am using a WatermarkTextBox inside a Grid. The WatermarkTextBox width depends on the Grid's width. I am using HorizontalAlignment="Stretch"

What is happening is when i input long text in my WatermarkTextBox, the textbox is growing. I don't want this to happen. 

I can't set a fixed width for the WatermarkTextBox since I need it to adjust based on the Grid's width. I just want the textbox Not to grow when I input long text.

How can I achieve this?

Thank you.

3 Answers, 1 is accepted

Sort by
0
gerardo
Top achievements
Rank 1
Veteran
answered on 28 Jul 2020, 07:07 AM
Any idea how can I prevent the Textbox grow when I input long text? 
0
Accepted
Vladimir Stoyanov
Telerik team
answered on 28 Jul 2020, 08:54 AM

Hello Gerardo,

Thank you for the shared information. 

Can you check out the following thread: Prevent a TextBox from horizontal expanding in WPF, where this scenario has been discussed? Note, that it is for the native TextBox control, however the RadWatermarkTextBox inherits it and the suggestions apply to it. 

I hope you find this helpful.

Regards,
Vladimir Stoyanov
Progress Telerik

0
gerardo
Top achievements
Rank 1
Veteran
answered on 29 Jul 2020, 04:24 AM

Thanks for that Vladimir. Got the idea to bind the MaxWidth of the RadWatermarkTextBox to the Grid.

Thank you

Tags
WatermarkTextBox
Asked by
gerardo
Top achievements
Rank 1
Veteran
Answers by
gerardo
Top achievements
Rank 1
Veteran
Vladimir Stoyanov
Telerik team
Share this question
or