We have an UltraWinGrid that is bound to a data source that implements the IDataErrorInfo interface. The SupportDataErrorInfo property is set to RowsOnly. When the Error property on the data source is set it is not immediately reflected in the grid. However, as soon as the ActiveRow changes the error icon on the grid row is displayed. Is there a way to make the error icon show up immediately?
If you are creating your own custom data source, then you need to make sure that it sends the proper notifications using the IList or IBindingList interface. The BindingManager does not use INotifyPropertyChanged as far as I know. Your data object here would have to notify the list of a change in the error status of the item, and then list would have to fire a notification for this through the IList or IBIndingList interface.
I downloaded the latest UltraWinGrid (v8.2) and the problem still occurs. Here's an example of a simple business object that you can use to re-create the issue. I populate a collection of these business entities and bind it to the grid, including a column containing the Error property so you can see that the error message is immediately reflected in the grid. I then set the Error property for one of business objects and the row's error icon is not displayed but the error message does appear in the bound column. When I click on the row on which the Error property was set the row's error icon appears. I can subscribe to the PropertyChanged event for every row in the grid and call Rows.Refresh when the Error property is set but I'm hoping there is a better way.
public class AddressEntity: IDataErrorInfo, INotifyPropertyChanged
{
private string _city;
private Dictionary<string, string> _errors = new Dictionary<string,string>();
set
}
_address = address;
_city = city;
get { return _addressError; }
_errors.TryGetValue(columnName, out result);
#endregion
public event PropertyChangedEventHandler PropertyChanged;
What is the data source? If the grid is not immediately reflecting the changes, then the data source must not be sending notifications that something has changed. Or else, the grid is not responding to those notificiations.
Now that I think about it, this sounds familiar. Are you using the latest Hot Fix? I think I vaguely recall something like this being fixed recently.
If you want to try to wok around the issue, try calling grid.Rows.Refresh(...). I would try using the FireInitializeRow option, first, but if that doesn't work, try the other two options.