Hello,
I've a simple XamGrid with a bounded items source. I want to validate the bounded data and highlight the column correspondingly.The user should now correct these data.
I've looked into the validation part of the documentation but this only refers to the validation of data, the user enters into the specific controls at runtime.
How can I achieve this?
Hi,
The XamGrid is using TextBlock controls to render cell content when not in edit mode and since the TextBlock does not have a border it is not possible to show existing errors on initial load. You could try and create a custom template when not in edit mode to use a more complex element but that will add some performance impact.
Or you could use the XamDataGrid control if the application is WPF only. The grid supports displaying errors on initial load since the cell presenter template there is different.
Please let me know if you have any other questions.
Thanks,
Slavi
Thanks for the answer,
with the XamDataGrid, I can easily define ValueConstraints.
But this errors are only shown in the specific cell.
My goal is, to have a separate column with an icon,displayed when the row contains any errors. So, the user can filter or search after errors.
I found the properties Host.DataError, Host.HasDataError in the documentation butI can't bring that together.
Perhaps someone has done that before?