This is a migrated thread and some comments may be shown as answers.

DataForm Validation

1 Answer 81 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Lucas
Top achievements
Rank 1
Lucas asked on 09 Jan 2013, 06:22 PM
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).

[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

1 Answer, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 14 Jan 2013, 05:00 PM
Hello Lucas,

May I ask you to send us a repro project that we would be able to debug on our side? You can do this via our support ticket system, which also grants 24h priority response.

All the best,
Ivan Ivanov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
DataForm
Asked by
Lucas
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Share this question
or