Declined
Last Updated: 21 Mar 2018 14:58 by John
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 16 Feb 2017 08:21
Category: Editors
Type: Bug Report
1
FIX. RadTextBox - cursor is not displayed and text is cut and not wrapped in TelerikMetro theme
To reproduce: please refer to the attached sample project and gif file.

Workaround: this.radTextBox1.MinimumSize = new System.Drawing.Size(0, 25);
or
Use RadTextBoxControl
8 comments
John
Posted on: 21 Mar 2018 14:58
Unfortunately, the issue remains: changing the Theme breaks the display of the textboxes, and so I have to fix it. Instead of Telerik providing some mechanism to do so, you leave it to me, and that requires a lot of tedious, error-prone code. A Telerik solution (maybe call it a workaround) would simplify things because Telerik can implement an event or something in the base class. I purchased Telerik because I wanted the Theme capability, but now I need tedious, error-prone code to make it work right. Yuck. Meanwhile, my other important issue was ignored, and that's why I let my subscription lapse.
ADMIN
Todor Vyagov
Posted on: 21 Mar 2018 14:09
Hello John,
We need to say that this case is about a textbox with Multiline property set to true. According to MSDN(https://msdn.microsoft.com/en-us/library/system.windows.forms.textboxbase.multiline(v=vs.110).aspx) a multiline text box allows you to display more than one line of text in the textbox control. The resizing behavior of Microsoft TextBox is the following: 
 - when the Multiline is set to true the text box will not automatically resize
 - when the Multiline is set to false the text box will automatically resize
RadTextBox hosts the standard.NET TextBox control, and this is why the behavior is exactly the same. This is the reason we have declined the issue. 
John
Posted on: 26 Feb 2018 15:39
I am not even a little surprised that this bug has been declined; fixing it would have made too much sense. Leaving it as is means users have to add a lot of tedious, error-prone code in order to allow end-users to switch Themes whereas a fix inside the component would be easy.
ADMIN
Todor Vyagov
Posted on: 26 Feb 2018 10:42
This is not an issue. It's just that when the Multiline property of RadTextBox is set to true, the AutoSize is automatically changed to false. When the TextBox is measured it returns the default size, which is 100x20, but in TelerikMetro theme, the default size of editors is 24 pixels and the height is not enough for the caret to fit and this is why it is not visible.
Solution:
The user needs to set the height(Size property) of the control.
ADMIN
Dess | Tech Support Engineer, Sr.
Posted on: 19 Jun 2017 10:07
Hello John, 

Thank you for the provided feedback. It is greatly appreciated. Feel free to use your workaround either in the ThemeResolutionService.ApplicationThemeChanged event or the ThemeNameChanged event at control level.
John
Posted on: 15 Jun 2017 14:40
There are several reasons why the workarounds recommended in the original post don't work for me. 

Some background: I am using the RadTextBox wrapped in a UserControl that is used in at least a hundred places and the RadTextBox is customized in response to several properties of the UserControl.

Using a minimum size is impractical because the font size varies and I'd have to map an appropriate minimum size based on the font-size. My workaround does not require that mapping. It reacts to the RadTextBox's current font-size and produces the correct height.

I do not want to use the RadTextBoxControl because at the time I entered the comment above, RadTextBoxControl had a performance issue (very slow when loading a lot of text) and an appearance issue (sometimes does not render selected text properly). I have not verified that the RadTextBoxControl issues are still outstanding.
ADMIN
Dess | Tech Support Engineer, Sr.
Posted on: 15 Jun 2017 13:00
Hello John,
Thank you for writing.

Could you please share why the provided workarounds don't suit your scenario? If your code snippet behaves according to your custom requirement, feel free to use it.

Thank you.
John
Posted on: 23 Feb 2017 14:36
I posted the support ticket that triggered this entry. The two workarounds above were not options for me. I added an extension method that I call to set the height, which works, but making sure to call it at the right time--such as when the user switches themes--is tedious.

public static void SetHeight(this RadTextBox textBox) {
   var fontHeight = textBox.Font.Height;
   var textBoxPadding = textBox.TextBoxElement.Padding.Size.Height;
   var borderThickness = textBox.TextBoxElement.Border.BorderThickness.Size.Height;
   var calculatedHeight = fontHeight + textBoxPadding + borderThickness;
   if (textBox.Height != calculatedHeight) {
      textBox.Height = calculatedHeight;
   }
}