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
125
How can I DeallocateCells but mantain Appeareance on ultragrid cells?
posted

Hi, 

I have this method:

 private void grid_InitializeRow(object sender, InitializeRowEventArgs e)    

at the begining  foreach (UltraGridCell cell in e.Row.Cells)   I set an Appeareance on cells

and at the end of the method I call e.Row.DeallocateCells();

That clear all the appeareance settings I put on each cell. I call this method because I need to release some memory that solves one bug related to out of memory exception.

Is there a way to set the default appeareance of the cells to the changes I made before call DeallocateCells?

how can I DeallocateCells realesing memory and mantain the appearence changes I want?

thanks

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi,

    There is no way to maintain an appearance on a cell that has been deallocated. That doesn't makes sense - the cell no longer exists, so it can't very well hold on to properties or sub-objects.

    Are you applying an appearance to every cell? Or only some cells?

    Are you trying to only deallocate the cells that do not have an appearance applied? I don't think there is a way to do that, but you can probably write your code in such as a way as to not allocate cells unnecessarily. You can also make your code a lot more memory efficient by re-using appearance objects, instead of creating a new one on each cell. These issues are discussed in more detail in the WinGrid Performance Guide.

Children