No empty strings

2 posts, 0 answers
  1. Anthony
    Anthony avatar
    53 posts
    Member since:
    Apr 2012

    Posted 11 Aug 2017 Link to this post

    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.

  2. Stefan
    Stefan avatar
    1073 posts

    Posted 16 Aug 2017 Link to this post

    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.
Back to Top