I have learned that RadGridView has data validation feature per cell and row. But in my case, I want data validation on GridView level. In my app, I have "Purchase Order Form". In this form, there is RadGridView for Purchase Order Items. The validation scenario is User must add at least one item to this RadGridView.
I use the way of Data Annotation and Validation Attribute in my ViewModel to check this validation.
[CollectionHasElements( ErrorMessage = "Purchase order must have at least one order item." )]
public ObservableCollection<PurchaseOrderItemDecorator> PurchaseOrderItemDecorators
{
get { return _purchaseOrderItemDecorator; }
set { SetProperty( ref _purchaseOrderItemDecorator, value ); }
}
The RadGridView successfully notify the error by showing Red Border around the grid. But it somehow failed to show the error message. I attached the screenshot of this RadGridView.
In normal telerik wpf controls, it usually shows the error message on top right corner red block triangle. I wish my Gridview act like that for showing validation error message.
Thanks.