Cell styles management

Usually the user will set style to an entire row, or column. It is need to be considered when the styles management implementation.

Put some styles to headers, rather than cells

ReoGrid saves styles information to each cells, except some special cases. They are:
  • Apply styles to entire spreadsheet (whatever how many cells exist)
  • Apply styles to entire row or column (whatever how many cells exist)
When user selecting entire spreadsheet, and set the styles to entire spreadsheet, ReoGrid save the style to a variable called RootStyle which is member of control class. And every header of rows, header of columns have same struct to store a row-style or a column-style, when the style to be applied to entire row or entire column.

Three positions to set styles will be processed specially:

What to be improved

Although consider to put styles to three special positions, the entire grid, any entire rows or any entire columns, is effectively to decrease memory usage. But I think this is not the best way to optimum styles management.

Think about when user setting a style to a range, now ReoGrid copy the styles to each cells, this is not very good since many cells hold same content of style. I consider that is there another solution which can have only one instance of style to be stored in memory, and other cells just hold a pointer to the instance of style.

Last edited Jan 13, 2014 at 12:42 PM by unvell, version 7