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

Is there named brushes or a style for the display of grid validation errors?

2 Answers 94 Views
DataGrid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
David
Top achievements
Rank 1
David asked on 05 Dec 2017, 11:20 AM
I have implemented validation on the grid, and there doesn't seem to be a way of styling the error messages.

2 Answers, 1 is accepted

Sort by
0
Accepted
Lance | Senior Manager Technical Support
Telerik team
answered on 05 Dec 2017, 10:48 PM
Hi David,

The reason you weren't able to find any style or property on the DataGrid is because it's actually a separate control: ValidationControl, which lives inside the Telerik.UI.Xaml.Controls.Primitives namespace.

This can be targeted directly in a style, for example:

<Style TargetType="primitives:ValidationControl">
    <Setter Property="Foreground" Value="Red"/>
</Style>


Here's an example of targeting the style, locally scoped to just the DataGrid's resources:

<grid:RadDataGrid >
    <grid:RadDataGrid.Resources>
        <Style TargetType="primitives:ValidationControl">
            <Setter Property="Foreground" Value="Red"/>
        </Style>
    </grid:RadDataGrid.Resources>
...
</grid:RadDataGrid>


Here's a screenshot at run-time:



Regards,
Lance | Tech Support Engineer, Sr.
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
David
Top achievements
Rank 1
answered on 06 Dec 2017, 09:34 AM
Thanks Lance. That's extremely helpful.
Tags
DataGrid
Asked by
David
Top achievements
Rank 1
Answers by
Lance | Senior Manager Technical Support
Telerik team
David
Top achievements
Rank 1
Share this question
or