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
466
How can i correctly remove rows from binded DataTable?
posted

Hello!

I have a DataTable object, and it binded to xamDataGrid component with this code:

xamDataGrid1.DataSource = MainTable.DefaultView;

When I remove some rows from MainTable, it remains visible in xamDataGrid1, but without any data - just empty lines. When I scroll to their, I can see large lags. Maybe I should call some invalidate method for xamDataGrid1? What is his name?

Thanks for helping and sorry for my bad english.

Parents
No Data
Reply
  • 130
    Offline posted

    I had the same issue and while quite a few years later my solution may help others.

    In my case I was add/removing from the DataTable/View from a different thread, this casued the events to be raised and handled in a non-UI thread and thus the XamDataGrid errored when handling them.

    Then when scrolling the XamDataGrid threw exceptions in the background that it couldn't find the rows that had been deleted causing the grid scroll to lag.

    The solution was to make all changes to the DataTable/View from the UI thread using Dispatcher.Invoke

Children
No Data