How do i set validation Error for XamCheckEditor?
In this case you can try to set the BorderBrush for the ValueEditorCheckBox inside the ControlTemplate :
<Style TargetType="{x:Type igEditors:XamCheckEditor}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type igEditors:XamCheckEditor}"> <Border x:Name="MainBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"> <igEditors:ValueEditorCheckBox x:Name="PART_FocusSite" IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsChecked, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsThreeState="{TemplateBinding IsThreeState}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}"> </igEditors:ValueEditorCheckBox> </Border> <ControlTemplate.Triggers> <Trigger Property="IsEmbedded" Value="False"/> <Trigger Property="ReadOnly" Value="True"> <Setter TargetName="PART_FocusSite" Property ="IsEnabled" Value="False" /> </Trigger> <Trigger Property="IsChecked" Value="False"> <Setter TargetName="PART_FocusSite" Property ="BorderBrush" Value="Red" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> <Style.Triggers> <Trigger Property="IsEmbedded" Value="False"> <Setter Property="BorderThickness" Value="1" /> </Trigger> </Style.Triggers> </Style>
Regards
Vlad
What about BorderBrush instead of Background? Will it work?
<Style TargetType="{x:Type igEditors:XamCheckEditor}"> <Style.Triggers> <Trigger Property="IsChecked" Value="False"> <Trigger.Setters> <Setter Property="ToolTip" Value="Check" /> <Setter Property="BorderBrush" Value="Red" /> </Trigger.Setters> </Trigger> </Style.Triggers> </Style>
Hello,
IsValueValid can't be used with the XamCheckEditor because it is returning only "true" value. Instead you can use the IsChecked property for that perpose :
<Style TargetType="{x:Type igEditors:XamCheckEditor}"> <Style.Triggers> <Trigger Property="IsChecked" Value="False"> <Trigger.Setters> <Setter Property="ToolTip" Value="Check" /> <Setter Property="Background" Value="Red" /> </Trigger.Setters> </Trigger> </Style.Triggers> </Style>
Hope this helps
I am using XamDataGrid Validation Feature.In the XamDataGrid i am validating the XamCheckEditor
Value whether the user selects the XamCheckEditor. I am able to set the Tooltip but i unable to set the
BorderBrush to Red. The following code doesn't have any effect.
<Style.Triggers>
<Trigger Property="IsValueValid" Value="false">
<Trigger.Setters>
<Setter Property="BorderBrush" Value="Red" />
</Trigger.Setters>
</Trigger>
</Style.Triggers>
How exactly do you want to validate the XamCheckEditor?
Regards,
Alex.