I have a WPF page with validation rules. This page has 2 grids - 1 that's shown by default, and another that can be toggled to show via an animation (a button is pressed, and the second grid's height is animated to show over top of the 1st grid, and the 1st grid is disabled).
My problem is this: I have validation rules on the first grid...
WPF: How do I prevent users from entering text in a Textbox data bound to a numeric property?
...
When I correct errors the red box around the cell disappears but the "!" mark indicating row validation errors doesn't go away.
This only seems to occur with a DataGridComboBoxColumn, text columns work correctly.
What could be causing this?
...
I have the following custom Validation.ErrorTemplate:
<Setter Property="Validation.ErrorTemplate">
<Setter.Value>
<ControlTemplate>
<DockPanel LastChildFill="True">
<Label DockPanel.Dock="Bottom" Foreground="Red" Content="{Binding ErrorContent}" Margin="...
how can I get this code to trigger a validation as typing occurs (cf when leaving the field). The code below works OK in terms of validation, however it does not work until leaving the field (not as you type).
XAML
<Grid.Resources>
<Style TargetType="{x:Type TextBox}">
<Style.Triggers>
<Trigger Property="Valida...
This is my current XAML.
<StackPanel Orientation="Horizontal" Grid.Column="3" Grid.Row="1">
<Label Content="Allocated:" FontSize="14"/>
<Label Content="{Binding AllocatedUnits, Mode=OneWay, ValidatesOnDataErrors=True}" ContentStringFormat="N0" FontSize="14"/>
</StackPanel>
How would I change this so that the red validation rec...