I am using telerik radgridview to bind to a collection of my model objects. Also, have added a validation rule class that triggers the validation.
Now i want to show a validation error around the radgridview row in case the error occurs. An custom error template is defined in my resource file. Below is the xaml for the same.
<telerik:RadGridView Grid.Column="0" Grid.Row="2" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto"
ItemsSource="{Binding Path=CollectionOfObjects}" SelectedItem="{Binding Path=SelectedObject, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
GdEvent:DoubleClickGridViewCommandBehaviour.OnDoubleClick="{Binding Path=GridRowDoubleClickCommand}"
RowIndicatorVisibility="Collapsed" ColumnWidth="*" EditTriggers="None" IsFilteringAllowed="False"
AutoGenerateColumns="False" AllowDrop="False"
CanUserFreezeColumns="False" CanUserReorderColumns="False"
CanUserDeleteRows="False" CanUserInsertRows="False" ShowGroupPanel="False"
SelectionMode="Single" SelectionUnit="FullRow">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Width="Auto" Header="Header1" DataMemberBinding="{Binding Header1}" TextAlignment="Left"/>
<telerik:GridViewDataColumn Width="Auto" Header="Header2" DataMemberBinding="{Binding Header2}" TextAlignment="Left"/>
</telerik:RadGridView.Columns>
<telerik:RadGridView.BindingGroup>
<BindingGroup NotifyOnValidationError="True">
<BindingGroup.ValidationRules>
<util2:ModelValidationRule ValidationStep="ConvertedProposedValue" ValidatesOnTargetUpdated="True" />
</BindingGroup.ValidationRules>
</BindingGroup>
But when i run the app, an the validation error fails. it is not showing any error against that row.
Please help
</telerik:RadGridView.BindingGroup>
<telerik:RadGridView.Resources>
<Style TargetType="{x:Type telerik:GridViewRow}">
<Setter Property="IsSelected" Value="{Binding Path=IsSelected, Mode=TwoWay}"/>
<Setter Property="Validation.ErrorTemplate" Value="{StaticResource ErrorTemplate}"/>
</Style>
</telerik:RadGridView.Resources>
Now i want to show a validation error around the radgridview row in case the error occurs. An custom error template is defined in my resource file. Below is the xaml for the same.
<telerik:RadGridView Grid.Column="0" Grid.Row="2" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto"
ItemsSource="{Binding Path=CollectionOfObjects}" SelectedItem="{Binding Path=SelectedObject, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
GdEvent:DoubleClickGridViewCommandBehaviour.OnDoubleClick="{Binding Path=GridRowDoubleClickCommand}"
RowIndicatorVisibility="Collapsed" ColumnWidth="*" EditTriggers="None" IsFilteringAllowed="False"
AutoGenerateColumns="False" AllowDrop="False"
CanUserFreezeColumns="False" CanUserReorderColumns="False"
CanUserDeleteRows="False" CanUserInsertRows="False" ShowGroupPanel="False"
SelectionMode="Single" SelectionUnit="FullRow">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Width="Auto" Header="Header1" DataMemberBinding="{Binding Header1}" TextAlignment="Left"/>
<telerik:GridViewDataColumn Width="Auto" Header="Header2" DataMemberBinding="{Binding Header2}" TextAlignment="Left"/>
</telerik:RadGridView.Columns>
<telerik:RadGridView.BindingGroup>
<BindingGroup NotifyOnValidationError="True">
<BindingGroup.ValidationRules>
<util2:ModelValidationRule ValidationStep="ConvertedProposedValue" ValidatesOnTargetUpdated="True" />
</BindingGroup.ValidationRules>
</BindingGroup>
But when i run the app, an the validation error fails. it is not showing any error against that row.
Please help
</telerik:RadGridView.BindingGroup>
<telerik:RadGridView.Resources>
<Style TargetType="{x:Type telerik:GridViewRow}">
<Setter Property="IsSelected" Value="{Binding Path=IsSelected, Mode=TwoWay}"/>
<Setter Property="Validation.ErrorTemplate" Value="{StaticResource ErrorTemplate}"/>
</Style>
</telerik:RadGridView.Resources>