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
2150
Large number of first-chance exceptions in XamDataGrid bound to ADO.Net
posted

I would love to decrease the number of exceptions that the debugger is encountering in the XamDataGrid.

I expect that these happen only when a number of factors are in play, and they only affect the debugger in a serious way when I disable "Just My Code" in VS 2015.

Basically here is how to recreate:

  • Bind to ADO.Net dataset in VM layer
  • Edit some data and scroll it out of view in the grid
  • In my VM layer I clear the ADO.Net dataset and accept changes

The exceptions that happen seem to be a result of an asynchronous refresh operation in the xamdatagrid (in FlatScrollRecordsCollection, to be exact):

  InfragisticsWPF4.DataPresenter.v15.2.dll!Infragistics.Windows.DataPresenter.FlatScrollRecordsCollection.RaiseCollectionChangedHelper(System.Collections.Specialized.NotifyCollectionChangedEventArgs eventArgs) Unknown
  InfragisticsWPF4.DataPresenter.v15.2.dll!Infragistics.Windows.DataPresenter.FlatScrollRecordsCollection.RaiseChangeEvent(System.EventArgs e, bool async) Unknown
  InfragisticsWPF4.DataPresenter.v15.2.dll!Infragistics.Windows.DataPresenter.FlatScrollRecordsCollection.RaisePendingNotifications() Unknown

This "RaisePendingNotifications" comes along to the front of the Dispatcher and it is presumably going to clear out my records from the U/I.

But I end up getting a TON of first-chance exceptions from GetCellValueHelper in DataPresenter.DataRecord like so:

GetCellValue failed, exception type: System.Data.RowNotInTableException, exception msg: This row has been removed from a table and does not have any data.  BeginEdit() will allow creation of new data in this row., item index: 8, DataItem: System.Data.DataRowView

I assume the XamDataGrid is not happy about the missing record data with DataRow entries that are no longer attached to a table (or maybe it is not happy working with ADO.Net bindings in general).

I've attached the full stack when encountering the RowNotInTableException.  Note that the repro would be difficult to give you because of several factors:

  • Only ADO.Net issue (clear based on Exception)
  • Only a significant debugger performance issue if I disable "Just My Code"
  • (although it probably affects performance to a degree either way)
  • Only seems to occur when I scroll records in and out of view on the xamDataGrid
  • Maybe additional factors...

I'd love to find a better way to keep the xamDataGrid "in step" with the changes to the data in the VM (ie in the VM layer I clear the ADO.Net dataset and accept changes)

Is there some straightforward way I can clear my old data *without* cause all the unnecessary overhead of async exceptions (which happen when the xamDataGrid attempts to bring itself back in sync)?  Can I create an interface/callback to the xaml view and unbind temporarily, or clear DataRecords manually, or something of that nature as a workaround?  Anything like that would be worth doing, as far as I'm concerned.  I'm open to ideas.  I'd like to stay with ADO.Net if possible.

Please let me know if there are any thoughts about a workaround.

  • 16495
    Offline posted

    Hello DBeavon,

    Thank you for the details you have provided.

    I created a sample application based on your scenario and I could not managed to reproduce the behavior that you have described. In the attached project  I bound the XamDataGrid to Dataset and by using button I am adding new records and columns.  If you are not able to reproduce the issue with the attached sample application, would you please modify it with the functionality, that you are using, so it reproduces the issue. It would be great if you provide steps to reproduce.  

    Would you please provide  me with  more detailed information regarding  environment in which you are developing your application like operating system, Service Release,  the specific version of our product that you are using ?

    This way I would be able to further investigate this for you and provide you with more detailed information on this matter.

    Looking forward to hearing from you.

    Sincerely,
    Zhivko
    Entry Level Software Developer

    LargeNumbetOfFCExceptionsADO.Net.zip