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
920
ErrorProvider for Grid
posted

Hello,

I have a GUI in which I have a Grid and some athoer controls.

I use DataBinding and the Data bound to the bindingsources are implementing IDataErrorInfoand INotifyPropertyChanged.

So when there is an error in the data all controls are displaying the error with the errorprovider.

Now, I have the problem that the validation of the data displayed in the grid is as followed:

The data displayed is just valid, if ALL Rows in the grid have the same e.g. Customer. When adding another row with an other Customer the complete Data of the Grid is invalid.

If this is the case I would like to have the errorProvider next to the Grid, like all other Controls do that.

I know that I can set the Error-Icon by hand and I know that each Row/Column can display an Error, but I want to have the Icon next to the Grid set automatically by binding an IDataErrorInfo.

How can I achieve this behaviour with the Grid?

 

Thanks in advance...