Objective Grid: Large number of hidden rows

Article ID: 698
Last updated: 07 Jun, 2018
Article ID: 698
Last updated: 07 Jun, 2018
Revision: 3
Views: 7612
Posted: 23 Jan, 2001
by Meltreger B.
Updated: 07 Jun, 2018
by Meltreger B.

Problem


Grid behaves strangely when there are a large number of hidden rows.


Cause


In Objective Grid hiding rows and columns is implemented in a way that when the user hides rows, these rows will be marked as hidden. However, the hidden row will still be treated as a regular row when it comes to scrolling or drawing the grid. So, when you scroll over a large amount of hidden rows you will realize that the scrollbar jumps. Also, if you show a grid with many hidden rows, you will recognize that drawing will slow down with the number of hidden rows.


Action


We have provided a sample (see attachment below) that implements a different technique for hidden rows.  The grid is made to draw the actual number of rows less the hidden rows (by overriding GetRowCount()), though the grid stores the actual number of rows in its CGXData object. This results in each visible row representing a different original row in the grid's data depending on the number of hidden rows above it. The sample maintains a mapping of the visible row to the actual row and provides this mapping when the grid "Gets" or "Stores" styles by overriding GetStyleRowCol() and StoreStyleRowCol().

This article was:   Helpful | Not helpful
Report an issue
Article ID: 698
Last updated: 07 Jun, 2018
Revision: 3
Views: 7612
Posted: 23 Jan, 2001 by Meltreger B.
Updated: 07 Jun, 2018 by Meltreger B.
Attached files
item hiderow.zip (64 kb) Download


Others in this category