I want to use RadGridView to display missing relations in a database using the Entity framework. I have defined several columns with path bindings to subtables. (eg. Table1.ID) When the datagrid is loading such a column with a 1 to 1 relation the entity framework throws an exception if the related row does not exist in the database, but the RadGridView does not display this error. (I tried several binding settings and manually added an ExceptionValidationRule and set the ValidateOnTargedUpdated = true, but the errors don't show up in the datagrid) The ultimate solution would be if I could display an error message like "Related row in Table XXX and ID 123 not found" in the tooltip of the grid cell.
The only way the error gets displayed is to write a validator which e.g. checks for null values and then to enter the cell edit mode. Then the error gets displayed. But I never got the entity framework exception to display in the datagrid.
Another approach is to write a DataTemplate for every column which triggers the Validation.HasError event. Using this method the errors get displayed when the column is bound, but this does also not work for entity framework exceptions and needs a lot of xaml code. What is the best solution to get a good error message without to write a lot of xaml code?
The only way the error gets displayed is to write a validator which e.g. checks for null values and then to enter the cell edit mode. Then the error gets displayed. But I never got the entity framework exception to display in the datagrid.
Another approach is to write a DataTemplate for every column which triggers the Validation.HasError event. Using this method the errors get displayed when the column is bound, but this does also not work for entity framework exceptions and needs a lot of xaml code. What is the best solution to get a good error message without to write a lot of xaml code?