Validate Cell is Unique in Column

Apr 28, 2009 at 8:04 AM

I'm using a DataGrid bound to an ObservableCollection<T>. The grid has five DataGridTextColumns. I want to add a validation rule to check that the first cell of the row is unique in the ObservableCollection, but I can't find a way of doing it. I know row level validation is possible, and if I could pass the observable collection to the validator I could check the items but ValidationRule isn't a DependencyObject so this doesn't work.

Has anyone managed to achieve column level validation? Any suggestions?

Apr 30, 2009 at 11:42 AM
Any ideas?
May 1, 2009 at 7:48 AM
Edited May 1, 2009 at 7:50 AM

The XCeed DataGrid seems to fire more useful events for helping with this, allowing for CellValidationRules. In fact the XCeed grid can do what I want ( http://xceed.com/CS/forums/thread/13649.aspx ), but I wanted to use the WPF toolkit grid.

Any chance of adding this in the future?