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

AutoCompleteBox entity "Required Field" validation message

1 Answer 323 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 16 Jul 2013, 04:28 AM
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...

1 Answer, 1 is accepted

Sort by
0
Vladi
Telerik team
answered on 18 Jul 2013, 11:12 AM
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 >>
Tags
AutoCompleteBox
Asked by
Rob
Top achievements
Rank 1
Answers by
Vladi
Telerik team
Share this question
or