DataGridTemplateColumn, validation and error notification

May 19, 2010 at 1:33 PM

I have problems with the notification of validation errors to the user when editing a DataGridTemplateColumn.

I use a DataGridTemplateColumn to show either floats, strings or dates with a datepicker. For the rows with either floats or strings I'd like the DataGridTemplateColumn to behave like an ordinary DataGridTextColumn, i. e. when the user provides a string or float that is not passing the validation a red border around the cell with the error should appear. And the incorrect input should remain in the cell.

I know that the best way to achieve this for template columns is to implement row validation rules rather than cell validation rules and template the row error adorner so that it appears around the cell, but how do I template the row error adorner? That is my question number one.

Question number two:
Also, I have implemented a row validation rule but when the validation fails there are no red border and no exclamation mark. I have checked that the validation works. So why doesn't the red exclamation mark show up?

So if you know anything about this, please help me out.
Anna

May 25, 2010 at 7:26 AM

Bump

May 28, 2010 at 6:21 AM

Bump. Please take a look at my problem. I am new to C# and WPF and I am completely stuck.