Hi
I am using data annotations to validate items in a collection presented in a RadGridView.
It successfully validates a property of an item in the collection e.g. a name is required
I now want to ensure the name is unique within the collection. I have tried adding the [Key] attribute but no error is indicated if I enter another item with the same name. It may be that [Key] is not appropriate in this context.
What can you suggest I do to implement this validation rule?
Thanks
Craig
PS. I'm using C#, WPF, MVVM, Rad Controls for WPF 2012.3.1129.40
I am using data annotations to validate items in a collection presented in a RadGridView.
It successfully validates a property of an item in the collection e.g. a name is required
// ...{ public class GroupOfItems { [Required(ErrorMessage="Name must be provided!")] public string GroupName { get; set; }// ...I now want to ensure the name is unique within the collection. I have tried adding the [Key] attribute but no error is indicated if I enter another item with the same name. It may be that [Key] is not appropriate in this context.
What can you suggest I do to implement this validation rule?
Thanks
Craig
PS. I'm using C#, WPF, MVVM, Rad Controls for WPF 2012.3.1129.40