Hi there!
As indicated I use the OData-DataSource reference implementation. Until I updated to 19.1 it used to work without any issues. SInce then I get a NullReference-Exception inside InitializeOriginalPropertyValues. I bet it's this line
this._originalPropertyValues = this.UnpackAndValidateUnderlyingDataItem(underlyingDataItem).Item1;
because UnpackAndValidateUnderlyingDataItem could result in null.
Anyone seen this? Know what to do about ?
TIA & Regards
Meinhard
Hi Andrew,
I think I found the problem. It has to do with the Requested Fields. Originally I did not set them, so I think someone calulates them in some way. Now, On the loading process we apply a stored layout to the grid and this seem to harm the ongoing loading process. After I set the RequestedFields to all available fields, it works as expected.
Thx again & Regards
thx for taking the time to look into this.
I did exactly the same and change the sample to use our OData Url. Works perfect, the only obvious difference is that the sample uses XamDataPresenter and I use XamDataGrid.
The application I am working on uses this a lot and what irritates me is, if I display a grid with a very few (<20) rows in it first, and then the bigger one (>3000) it behaves as expected. If I display the big one directly after program start => crash.
Is there any documentation available of how to build a debug version of the Infragistics assemblies and how to use them?
Regards
Hello Meinhard,
I have been investigating into this issue you are seeing, and I see the piece of code that you are referring to that you believe could be the issue in this case, but it appears that we are checking the underlyingDataItem object that we pass into the UnpackAndValidateUnderlyingDataItem for null prior to passing it – and it won’t be passed if it is null. It appears that the only way this method should ever return null is if the count of the property descriptors on the OData object is out of sync with the creation of that object for use with the grid.
With the above said, I have been looking for an error returned that seems to match this, but I haven’t found one, and so I pulled down our OData sample project from our GitHub repository: https://github.com/Infragistics/DataSource-Reference-Implementations. Using this, I cannot seem to reproduce the behavior you are seeing when running against version 19.1.20191.164 of the Infragistics for WPF product.
I am attaching the sample project here. Note, not all of the OData feeds seem to work in this case, but the Adventure Works ones do, and so I would recommend switching to use that.
Please let me know if you have any other questions or concerns on this matter.
DataGridODataTest.zip