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

Any way to reuse the Telerik ErrorTemplate on stock WPF controls?

1 Answer 112 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 17 Oct 2012, 05:21 PM
I'm introducing validation in an MVVM style application using the IDataErrorInfo method and I noticed that the RadGridView control has a pretty cool default template defined for the error tooltip whereas the stock WPF controls such as TextBox only provide the red outline by default. Since I have yet to define my own custom control template for assigning to the attached Validation.ErrorTemplate property of my TextBoxes I was curious if there is any simple way that I can reuse the existing template defined in the Telerik WPF control suite.

I'm guessing it would mainly require that I know the style key so can set these properties manually or though an implicit style. Is there any guidance on how one would go about this and with the least amount of hassle? Also please note that I'm technically not running a WPF application as we are embedding WPF UserControls within a WinForms application for the time being and have no App.xaml file that we could use to declare default resources for the entire application. This means any solution will probably have to be repeated for each user control if that affects the technique recommended to reuse this template.

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 19 Oct 2012, 12:03 PM
Hello,

You could edit the templates of GridViewCell  (for validation in View mode) and GridViewEditorPresenter (for validation in Edit mode) and check how the Validation templates are defined there. You can then define similar ones for the MS TextBox using Microsoft Expression Blend. There is not an automatic way to reuse the same template, you will have to write yours based on the one for the GridView.

All the best,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
General Discussions
Asked by
Jeff
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or