Hi
I'm trying to get DataForm validation up and running for my WCF Service based application. I'm using item level attribute-based validation according to http://www.telerik.com/help/wpf/raddataform-validation-item-level.html. This is working fine if I add the attributes directly to the DTO classes generated by the Open Access Service Wizard (i.e. directly in Transport.cs).
However, as adding the metadata to Transport.cs is probably not the best idea, i tried to move the metadata to a seperate metadata class and inject it to the DTO via a MetaDataTypeAttribute.
But i couldn't get this to work, the DataForm ignores the metadata while validating. Is there something I've missed or is this fature not supported by RadDataForm?
Regards
I'm trying to get DataForm validation up and running for my WCF Service based application. I'm using item level attribute-based validation according to http://www.telerik.com/help/wpf/raddataform-validation-item-level.html. This is working fine if I add the attributes directly to the DTO classes generated by the Open Access Service Wizard (i.e. directly in Transport.cs).
[DataMember]
[Required]
public
virtual
string
Name {
get
{
return
this
._name;
}
set
{
if
(Name == value)
return
;
this
.OnPropertyChanging(
"Name"
);
this
._name = value;
this
.OnPropertyChanged(
"Name"
);
}
}
However, as adding the metadata to Transport.cs is probably not the best idea, i tried to move the metadata to a seperate metadata class and inject it to the DTO via a MetaDataTypeAttribute.
[MetadataTypeAttribute(
typeof
(EmployeeDto.Metadata))]
public
partial
class
EmployeeDto
{
internal
sealed
class
Metadata
{
private
Metadata() {
}
[Required]
public
string
Name {
get
;
set
; }
}
}
But i couldn't get this to work, the DataForm ignores the metadata while validating. Is there something I've missed or is this fature not supported by RadDataForm?
Regards