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

No empty strings

1 Answer 296 Views
WatermarkTextBox
This is a migrated thread and some comments may be shown as answers.
Anthony
Top achievements
Rank 1
Anthony asked on 11 Aug 2017, 05:09 PM

My scenario is that I'm binding to a string value and I don't want empty strings. By default the value is null, but if I change it to something and then go back and clear it the value is now an empty string. The OOB TextBox exhibits the same behavior.

I've implemented an IValueConverter that through Convert and ConvertBack eliminates any possibility of an empty string; however, I'm still left wondering if there's a better approach. Please enlighten me if there is.

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 16 Aug 2017, 08:48 AM
Hi Anthony,

RadWatermarkTextBox control is intended to extend the standard MS TextBox control by providing additional mechanism for altering its content for empty and non focused states. A mechanism for such validation is not supported. Thus, you can stick to the approach of using an IValueConverter which you have already found.

More information can be found in the Features section of RadWatermarkTextBox's online help.

All the best,
Stefan X1
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
WatermarkTextBox
Asked by
Anthony
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or