I have a customized cell template.
<
telerik:GridViewDataColumn
Header
=
"Contact"
DataMemberBinding
=
"{Binding CustAccountsLocationContact.FirstName}"
>
<
telerik:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
TextBox
Text
=
"{Binding SomeText, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}"
/>
</
DataTemplate
>
</
telerik:GridViewDataColumn.CellTemplate
>
</
telerik:GridViewDataColumn
>
Now in Model class SomeText property there is a [required] attribute. Similar this, I created the error template as
<
ControlTemplate
x:Key
=
"errorTemplate"
>
<
DockPanel
>
<
Border
BorderBrush
=
"Red"
BorderThickness
=
"1"
>
<
AdornedElementPlaceholder
x:Name
=
"controlWithError"
/>
</
Border
>
<
TextBlock
Foreground
=
"Red"
FontSize
=
"20"
FontFamily
=
"Segoe UI"
Margin
=
"3,0,0,0"
MouseDown
=
"Exclamation_MouseDown"
Tag
=
"{Binding AdornedElement.(Validation.Errors)[0].ErrorContent, ElementName=controlWithError}"
>!</
TextBlock
>
</
DockPanel
>
</
ControlTemplate
>
However I can not see the error template if validation failed. By the answer on stackoverflow, it seems need to wrap some template with <AdornerDecorator>
Is it the solution to my case? If so, how to wrap it around telerik control?
Thank you.