Hi,
I'm populating an ultragrid.datasource with a datatable. I've got on the InitializeRow event a method that inserts an image on certain column. I've got a button that after clicked return new datatable and it substitue the ultragrid.datasource. The problem is that each time that the ultragrid.datasource has other datatable the memory increases all the time, until the program launch an exception of memory usage.
I've already tried ultragrid.datasource = null before setting the new datatable. Tried:
ultragrid.DisplayLayout.Reset();ultragrid.Layouts.Clear();
Nothing works. It seems that the grid is saving old sources. How could i clear it?
Since you mentioned the images, does that mean if you do not add in the images to the grid that the problem does not occur?
How, exactly are you getting your images and how are you applying them to the grid? My guess is that you are not disposing of the image objects you create. But that's just a guess, since I don't know how you are getting or using your images.
Also, what version of the grid are you using?
Even if i take off the images every time i refresh the grid the memory usage increases. Increases slower but still increase and after a while the application blows because of that. Is there something else i should dispose after refreshing datasource of the grid? I don´t have any datatable object, i return directly from database to datasource like this: grid.DataSource = AccountService( ).GetTasksDT( );
fzenha said:I don´t have any datatable object,
So you are calling a method that probably creates a new DataTable and assigns it directly to the DataSource of the grid and you are therefore never disposing of that DataTable. You should store the DataTable in a variable or get it from the grid and dispose it when you don't need it any more.