This question is locked. New answers and comments are not allowed.
Hi, I have a dataform, and i am implementing IDataErrorInfo, the problem i am encountering is that errors are being displayed twice for instance "Please Provide First Name" is repeated twice in the validation summary. I am using a style for the validation summary which i actually saw in one of your samples "CRM". This is what the style looks like maybe someone can spot whats causing my issue;
And heres an example of one of my Validation columns;
Then my dataform on the fields i need validated I have;
I appreciate any help, thanks
<
dataForm:DataFormValidationSummary
x:Name
=
"PART_ValidationSummary"
Visibility
=
"Collapsed"
Grid.Row
=
"3"
Height
=
"Auto"
>
<
dataForm:DataFormValidationSummary.Style
>
<
Style
TargetType
=
"dataForm:DataFormValidationSummary"
>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
>
<
ItemsControl
IsTabStop
=
"False"
ItemsSource
=
"{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Errors}"
Background
=
"{StaticResource ValidationBrush}"
Foreground
=
"{StaticResource MainBrush}"
>
<
ItemsControl.Style
>
<
Style
TargetType
=
"ItemsControl"
>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
>
<
ScrollViewer
IsTabStop
=
"False"
Name
=
"ScrollViewer"
Background
=
"{TemplateBinding Background}"
BorderThickness
=
"0"
ScrollViewer.VerticalScrollBarVisibility
=
"Auto"
ScrollViewer.HorizontalScrollBarVisibility
=
"Auto"
Foreground
=
"{TemplateBinding Foreground}"
>
<
ItemsPresenter
/>
</
ScrollViewer
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
<
Setter
Property
=
"ItemTemplate"
>
<
Setter.Value
>
<
DataTemplate
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
TextBlock
Margin
=
"5,5,0,5"
Text
=
"{Binding Path=ErrorContent}"
/>
</
StackPanel
>
</
DataTemplate
>
</
Setter.Value
>
</
Setter
>
<
Setter
Property
=
"MaxHeight"
Value
=
"75"
/>
</
Style
>
</
ItemsControl.Style
>
</
ItemsControl
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
<
Setter
Property
=
"MaxHeight"
Value
=
"75"
/>
</
Style
>
</
dataForm:DataFormValidationSummary.Style
>
</
dataForm:DataFormValidationSummary
>
string
_error;
const
string
ErrorText =
"Error in Member Details"
;
public
string
Error
{
get
{
return
_error; }
}
public
string
this
[
string
columnName]
{
get
{
_error =
null
;
switch
(columnName)
{
case
"EnvironmentName"
:
{
if
(
string
.IsNullOrEmpty(EnvironmentName))
_error =
"must contain data"
;
break
;
}
}
return
_error;
}
}
Then my dataform on the fields i need validated I have;
NotifyOnValidationError
=True,ValidatesOnDataErrors=True
I appreciate any help, thanks