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

Validation errors of controls inside RadExpander Control

2 Answers 59 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Prasad
Top achievements
Rank 1
Prasad asked on 28 Aug 2017, 05:00 PM

Hi ,

 

I have enclosed multiple textboxes and drop down controls inside RadExpander control. Some of the controls have Required filed attached.

I have RadExpander collapsed by default. When i expand RadExpander ,Validation errors for these controls are not getting displayed.

But once i expand the RadExpander control and go to a different tab and come back i see the validation errors. I tried to call a command explicitly on expanding the RadExpander control , validations are firing but messages are displayed against the controls. 

 

Let me know if any faced this kind of issue and solution for this.

 

Regards,

Prasad.

2 Answers, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 31 Aug 2017, 11:29 AM
Hello ,

Thank you for your interest in RadExpander control.

This is because when the expander is collapsed initially its Content (the TextBox in your case) is not added in the application's visual tree until it expands for the first time. This behavior is similar to the one described in the following StackOverflow question. 

What I can suggest you is to wrap the text boxes into an AdornerDecorator. For example:
<telerik:RadExpander Header="Demo" IsExpanded="False" VerticalContentAlignment="Top">
    <AdornerDecorator>
        <TextBox Text="{Binding Text, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"  />
        </AdornerDecorator>
</telerik:RadExpander>

Give this approach a try and let me know if it works for you. 

Regards,
Dinko
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.
0
Prasad
Top achievements
Rank 1
answered on 05 Sep 2017, 09:36 PM

Hi Dinko,

 

Thanks for response. My issue has been resolved for now. Will get back if i face any further issues.

 

Regards,

Prasad.

Tags
General Discussions
Asked by
Prasad
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Prasad
Top achievements
Rank 1
Share this question
or