I am using the 9.2.20092.2001 hot fix of the 9.2 libraries and am having a hard time getting IDataErrorInfo support to work correctly. I have a class called Data that implements INotifyPropertyChanged and IDataErrorInfo. My IDataErrorInfo properties both have a Console.WriteLine in there to let me know when they are being called.When the data is first bound to the grid, the Error property is called multiple times. However, the this[string columnName] property is never called. Whenever I update a property, nothing happens. Should I be notifying when my Error property changes? Is there a sample somewhere on how to properly implement IDataErrorInfo so that the XamDataGrid supports it.
Edit: I am setting the properties: DataGrid.FieldLayoutSettings.DataErrorDisplayMode = DataErrorDisplayMode.Default; DataGrid.FieldLayoutSettings.SupportDataErrorInfo = SupportDataErrorInfo.RecordsAndCells;
Thanks,-Szymon
Hi Szymon,
There's an IDataErrorInfo sample in the XamFeatureBrowser under xamDataGrid -> Layout and Behavior that implements IDataErrorInfo on a list object. Having said that, I don't know why the IDataErrorInfo indexer is not getting called initially - I'd think that it should for cells that are displayed in the data presenter when the window comes up. Cell errors are displayed in the feature browser sample mentioned above so I'm not sure what's different about your setup. Can you post a sample or code snippet?
Also you should notify when the Error property changes and also when the error for a field changes (for the field error, raise the property change event for the property of the object associated with that field).
Hope this helps,
Sandip
I managed to replicate in XAML:
<igDP:XamDataGrid x:Name="grid" DataSource="{Binding}"> <igDP:XamDataGrid.FieldLayoutSettings> <igDP:FieldLayoutSettings SupportDataErrorInfo="RecordsAndCells" AutoGenerateFields="False" DataErrorDisplayMode="ErrorIconAndHighlight" />
</igDP:XamDataGrid.FieldLayoutSettings> <igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout> <igDP:FieldLayout.Fields> <igDP:UnboundField Label="First Name" BindingPath="FirstName" BindingMode="TwoWay"> <igDP:UnboundField.Settings> <igDP:FieldSettings AllowEdit="False" /> </igDP:UnboundField.Settings> </igDP:UnboundField>
<igDP:UnboundField Label="Last Name" BindingPath="LastName" BindingMode="TwoWay"> <igDP:UnboundField.Settings> <igDP:FieldSettings AllowEdit="False" /> </igDP:UnboundField.Settings> </igDP:UnboundField>
<igDP:UnboundField Label="Age" BindingPath="Age" BindingMode="TwoWay"> <igDP:UnboundField.Settings> <igDP:FieldSettings AllowEdit="True" /> </igDP:UnboundField.Settings> </igDP:UnboundField> </igDP:FieldLayout.Fields> </igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts>
In this case, it doesn't work. But if I do not declare my fields and set AutoGenerateFields to True, it works.
That explains it - currently unbound fields don't display the error info because the unbound field simply gets its value from the binding created using the specified binding path and doesn't have any knowledge of the object from which the value came from, especially in cases where the binding is complex and points to a property on a nested object of the data item. However in your case it is not a complex binding path so it should be able to get the error information from the underlying data item. In response to your post, we've created a bug report to look into supporting IDataErrorInfo on unbound fields.
Thanks,
It seems to be a know bug that IDataErrorInfo does not support in an UnboundField properly. Have you already released a fix on this? Or do you have a schedule when it shall be fixed?
Thanks!
Edward
i would like to bump this
Are you still working on a fix for Idataerrorinfo on unbound fields? Can we expect a solution in the near future?
Regards
Stef
I'm looking for a fix for this too. Any updates?
Hello,
The issue with the Unbound fields is already fixed and will be included in the next service release. More details about the service release dates can be found here:http://es.infragistics.com/support/default.aspx#ServiceReleases
I hope this helps.
Sincerely,DimiDeveloper Support EngineerInfragistics, Inc.