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
40
xamDataGrid Memory Issue
posted

Hi

We use a number of xamDataGrids in our application embedded inside tab controls.

We have noticed that the xamDataGrid does not release previously bound objects until the Loaded event is raised. So if a grid is not visible but its DataSource is changed it does not release the previously bound objects until the grid is made visible.

I have attached a repro project.

  1. Run the application;
  2. You will see the grid in the first tab is bound to a collection with two Person objects;
  3. Switch to the second tab and click the Update button. This updates the DataSource bound to the grid;
  4. DO NOT switch batch to the first tab.
  5. Run a memory profiler and you will see the xamDataGrid is still holding onto the old Person objects;

Is there a way to completely flush the xamDataGrid if it is not visible and thus release the previously bound objects?

I have also attached a screenshot from ANTS Memory Profiler which shows the xamDataGrid still holding onto one of the old Person objects.

Thanks

Chris

XamDataGridMemory.zip
Parents Reply Children
No Data