Hi,
We recently had an issue reported about on of our apps running under citrix. The symptom was that if the app was minimised then maximised then the ribbon was blank. Only happened on one screen. We traced the problem to the listobject's IDataErrorInfo.Error setting a property on the underlying entity, causing validation to fire, rinse and repeat. After fixing this though, I noticed the method was still being called very frequently, particularly when the mouse moved over the grid, triggering a repaint which eventually called the Error method. Is this intentional behaviour, and if so why? Is there any property I can set to manually control when validation takes place
Thanks,
Kevin
Hi Kevin,
I'm a little confused about the relationship between the Ribbon and IDataErrorInfo. Ribbon has no support for DataBinding or IDataErrorInfo that I am aware of. So I assume you are talking about WinGrid here?
In any case, the grid is going to need to call into the IDataErrorInfo interface any time the row or cell paints and that includes when the mouse moves over a cell or row. So you need to make your IDataErrorInfo interface as efficient as possible. If you are re-validating the data every time this interface is called, then that will be very inefficient. You should cache the validation results and only re-validate when the data changes.
No, I meant the ribbon. App has a ribbon, childform has the grid. under citrix the ribbon wasn't repainting, as a result of the constant validating (due to our bug). I see why you might need to revalidate the listobject if you repaint the cell, if the grid doesn't cache the last result, and I can see can see in some circumstances that might be desirable. What killed it for us though was that Error was being called to revalidate the whole object rather than Item to revalidate the field who's cell was being redrawn. Individual field validation was lightweight, but we had an unavoidably expensive extra bit of validation in the Error implementation.