Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2589
Binding to dynamic data - item validation is not working
posted

Hello

I build a class with Reflection and then bind grid to ObservableCollection<object>. Dynamically created class inherits INotifyPropertyChanged and has all methods I need. This works fine when I only need to display data.

When I set AutoGenerateColumns to true and remove Columns, grid cells display something like Mynamespace.Myclass etc. And in this case I can see notification tooltip when I delete data from cell. But when I create template columns and set AutoGenerateColumns to false, validation won't work.

Solution attached. You only need to uncomment columns in XAML to see the error.

 

BTW, looks like validation won't work even with "usual" cell data if they bind to a complex object.