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
60
Bug switching datasources in FieldLayout.VerifyAllPropertyDescriptorProviders
posted

I see what looks like a bug in infragistics xamdatagrid.

What I am doing is

a) Changing grid.DataSource to a new ITypedList

b) calling dispose on my old list

c) Adding a new field to the current fieldlayout (which is still valid for the new datasource)

The grid is calling back at step c on my original datasource asking for ItemProperties.  My collection is already disposed, so this throws.  Once you change DataSource, why would the grid care about the old datasource -- especially when my fieldlayout was created manually -- and before I set the datasource at all.

Here is the call stack:

 InfragisticsWPF3.v10.3.dll!Infragistics.Windows.Internal.TypedListPropertyDescriptorProvider.GetProperties() + 0x2d bytes 
  InfragisticsWPF3.DataPresenter.v10.3.dll!Infragistics.Windows.DataPresenter.FieldLayout.LayoutPropertyDescriptorProvider.VerifyFieldDescriptors() + 0x15b bytes 
  InfragisticsWPF3.DataPresenter.v10.3.dll!Infragistics.Windows.DataPresenter.FieldLayout.VerifyAllPropertyDescriptorProviders() + 0x90 bytes 
  InfragisticsWPF3.DataPresenter.v10.3.dll!Infragistics.Windows.DataPresenter.FieldCollection.InsertItem(int index, Infragistics.Windows.DataPresenter.Field item) + 0x19f bytes 

GetProperties is calling into the wrong object.

This is wrong on a few levels -- because the propertydescriptors themselves may have changed while the field definitions are still valid.

It looks like when the internal DataSource property changes, it only changes the propertydescriptor providers if the fieldlayout isn't already initialized.  So it seems to be holding a weakref on the old datasource for this validation.

You probably want to reinitialize _propertyDescriptorProviders when the DataSource changes.  At least, this is what I can gleam from reflector.

Thanks for any help.