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
1715
Issue with IDataErrorInfo support
posted

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

Parents
  • 2070
    posted

    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

     

Reply Children