It would be great if we could prevent iGrid from initiating a redraw each time we access a combobox cell!
These are the nature of combo box cells and the basics of form interaction in Windows. If you open the drop-down list, another popup window covers the main grid window. When the drop-down list is closed, the iGrid window should be updated (redrawn) as it was covered by another window.
We cannot prevent the grid redraw in this case at all, but the question is why does this work so bad in MS Access when we have no problems with the same code in other development environments??
Please find attached a short video that demonstrates an Image Viewer CP Pro ActiveX Control from Viscom Software. As you can see, it doesn't redraw while iGrid does.
The comparison is not correct. A grid is a much more complex control if we talk about its visible part, it is not just a rectangle that displays a static image (though the Image Viewer control can be sophisticated in other parts, such as internal image processing algorithms).
Hi Igor,
thanks for your reply. The status is as follows:
- [SOLVED] the redraw of the grid when a picture outside the grid is changed. It actually works if an additional iGrid is used as "image control" (i.e. CellIcon method) to display the picture (and not the standard picture control)
- [OPEN] redraw of the WHOLE grid when a ComboBox Control within a cell is either opened and/or a new item selected.
You wrote that you cannot do anything about the redrawing of the whole grid, when a ComboBox is selected and that this would be some aspect specific to Access.
However I would like you to have a second look into that topic:
If you open a ComboBox the Event-Handlers for Before/AfterCellContentsDraw are called for EVERY VISIBLE CELL within the grid. This behavior is not triggered by Access.
Example: Let’s consider a grid with 50 rows and 15 columns. Column 1 would be the cell with a ComboBox. If you then clicked on Cell(row=48, col=1) and opened the ComboBox ALL 50 ROWS were redrawn.
However all the redraws for row 1..47 are unnecessary. In the exemplary setup this would mean that there are at least 47 * 15 = 705 avoidable cell redraws!
The same happens, after an item from the dropdown list is selected.
In the case of a ‘normal’ cell selection change only the row(s) of the cell that lost and the one that got the focus are redrawn.
(even though also in that case all cells within the affected row(s) are redrawn and not just the cell that lost / got the focus)
I think the ‘flickering’ in the ComboBox selection case might have something to do with the described update behavior.
Access as an environment might be sub-ideal too, but if only the rows needing an update would be redrawn the effect on the user would be far less dramatic.
It would be great if you could offer a solution on that, because the effect is really bad on big grids (which we unfortunately need a lot).
Nobody knows the redraw behavior of the grid better than you, but for testing convenience you find a database attached to that post.
The database outputs the row and line of the AfterCellContentsDraw-Event in the Debug-Window. Just change selection or click on the
Thanks,
Marc