AutoCompleteBox entity "Required Field" validation message

2 posts, 0 answers
  1. Rob
    Rob avatar
    10 posts
    Member since:
    Nov 2012

    Posted 15 Jul 2013 Link to this post

    How do I display an inline validation message on a RadAutoCompleteBox in Silverlight e.g. "Required Field"?

    I have the following XAML code bound to an entity with a "Required" attribute on it:

    <telerik:RadAutoCompleteBox Grid.Column="0"
                                            Grid.Row="2"
                                            Margin="0,0,2,0"
                                            ItemsSource="{Binding LiquidOutputUnits}"
                                            DisplayMemberPath="OutputUnit"
                                            SelectionMode="Single"
                                            TextSearchMode="Contains"
                                            FilteringBehavior="{StaticResource RadAutoCompleteBoxEmptySearchShowAllFilter}"
                                            SearchText="{Binding ChemCodeFormModel.LiquidSearchText, FallbackValue='', TargetNullValue='', Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True, ValidatesOnNotifyDataErrors=True}"
                                            SelectedItem="{Binding ChemCodeFormModel.LiquidSelectedItem, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True, ValidatesOnNotifyDataErrors=True}"
                                            />


    If I bind the "SearchText" binding to the Text property of a TextBox the validation message displays as expected and I have plenty of other input controls on the form that are bound in the same way including to a RadComboBox and they are also working as expected.

    Edit: I've justed added a BindingValidationEvent to the code-behind and the Validation Exception is definitely being caught, it's just not being displayed - I just want the typical red highlighting with the red popup-box...

  2. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 18 Jul 2013 Link to this post

    Hi,

    In our latest released versions of RadAutoCmpleteBox there is a built-in validation Style and all you need to is to implemented a data validation in your ViewModel.

    I created and attached a sample project for you that shows how to achieve a validation in the control in which there is a validation Tooltip message, hope this is helpful.

    Regards,
    Vladi
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft banner
Back to Top