6 Answers, 1 is accepted
Keep in mind that the TextTrimming property is applicable only for TextBlock element. If you want to have such functionality in a text input controls (as RadMaskedTextInput or TextBox) you will need to implement it with custom code that trims the text when the focus is lost. You can take a look at the following StackOverflow question that describes such implementation.
As a side note, the controls from the RadMaskedInput suite expose a TextBoxStyle property that accepts a Style which targets TextBox element. You can use this style to customize the TextBox that represents the text in the masked input components. Also you can use the style to apply an approach similar to the one demonstrated in the StackOverflow question.
Regards,
Martin
Telerik
See What's Next in App Development. Register for TelerikNEXT.
the stackover flow question weblink you provided has nothing to do with a RadMaskInput control.
I can find stack over flow question on common wpf controls all over the internet. I am specifically asking how and if this can be done on a the RadMaskInput control in an easy was an I was hoping for a simple project downloadable source code example.
I used the suggestion from the website and applied it to the RadMaskTextInput TextBoxStyle property. But now there is problem of the text being off centered in the RadMaskTextInput control as opposed to a RadMaskTextInput control without the TextBoxStyle being set. That is usually what happened when snippet of code of the web. The snippet may fix one problem but introduced a slew of other problems.
I set the TextBox Style's margin, padding, borderwidth to zero. This solved some of the visual problems that occurs when comparing how the text appears in a RadMaskTextInput with the TextBoxStyle being set asopposed to one that does not have the TextBoxStyle set.
I attached a picture and a simple program showing the how the text is positioned differently between the two RadMaskTextInput controls. The control with the TextBoxStyle set positions text all the way to left and higher then the text in a control without a TextBoxStyle set..
The attached program had to be sent with a jpg extension (WpfAppTextTrimRadMaskTextInput.jpg) After downloading this file change the extension to zip and then unzip the file and then you can access the simple wpf program .
Do you see any fixes that need to be done to the TextBox style so both text are positioned identically in both controls.
Martin that example you provided on the weblink was quite helpful. It took me hours to correct some visual visual problem but that solution you provided let me to allow text wrapping by just setting the property in the style.
Thanks for the help:)
I believe that I already answered all these questions in your other threads.
Please feel free to contact us again if you encounter any other issues.
Regards,
Pavel R. Pavlov
Telerik
See What's Next in App Development. Register for TelerikNEXT.