enjoyit
2016-05-13T08:48:52Z
Hi,

is there anybody who can give me a hint how i can draw a progess bar inside the grid?

The progress bar should have a green range for the done part and a red range for the undone part. So there is a 100 percent bar which contains these two parts. 100% done is a full green bar at the end.

Is that possible?

Drawing the red circle like in the example is working without Problems.

thank you in advance!
Igor/10Tec
2016-05-14T04:30:00Z
The Folder Size Manager and Custom Draw Cells samples from the main iGrid demo demonstrate how to draw customized progress bars in iGrid cells.
Trevor Finch
2016-05-14T07:00:38Z
The code samples really are excellent

Set the color with e.g. CreateSolidBrush(vbRed) or RGB() instead of a system color

The 'CustomDraw' event seems to raised asynchronously, whenever the cell needs redrawing, not as the grid cells are loaded.

So if the grid is filled from a recordset, and the values used by the progress bar come from fields in the recordset, then those fields need to be in the grid.

Alternatively you need to re-position the current record in the CustomDraw event

CustomDraw also seems to be raised whenever any cell in that row is changed (???), which saved a lot of code
Igor/10Tec
2016-05-16T08:36:48Z
All operations in iGrid, including its events, are synchronous.

The CustomDrawCell event is raised only when a cell must be redrawn. For instance, when it becomes visible in the viewport or when its value has been changed. If you need to force iGrid to redraw a cell, use the DrawCell method or even Refresh.

And if I understand the logic of your app properly, you do not want to store progress bar values in iGrid cells and want to retrieve them dynamically from the underlying recordset in your CustomDrawCell event handler. This approach will slow down the performance of your grid a lot as the CustomDrawCell event can be raised many times for the same cells while the user sees them in the viewport (for instance, during scrolling). In fact, you will need to reposition the current record many times a second for those cells. I recommend that you copy all required values into iGrid cells and access them from this "native store".
Trevor Finch
2016-05-16T22:59:53Z
Thankyou Igor

Are you saying that the CustomDraw event is raised when *any* cell in the grid is changed, or just cells in it's row ?

This application gets external data (via RS232), but we know which record in the recordset has been updated

So we just re-load that row in the grid, and that automatically fires CustomDraw

And thankyou for your suggestion about re-positioning the record.

The end-users can configure the grid, so it is possible the values feeding the progress bar might not be in the grid

So we will have to add them as hidden columns

---
Even with recordset re-positioning, the grid refresh is so fast it was only with lots of debug.print's could we work out what was going on.
Igor/10Tec
2016-05-17T06:41:56Z
The CustomDrawCell event for a cell is raised when this cell must be updated on the screen. This happens in many situations - for instance, when you change the cell's value from code.

However, the iGrid drawing routine is highly optimized, and iGrid redraws the whole row when one of its cells is changed or needs to be redrawn. Sure, only the cells in the columns visible in the viewport are updated. In fact, this part of a row is drawn in an internal buffer and then it is copied to the screen to avoid flickering.
enjoyit
2016-05-17T11:41:55Z
Hi, I'm using Access 2010.

I can't find an example what I can use? Yes there is an example but this only shows the result but not how to do?

greets
enjoyit
2016-05-18T09:13:28Z
Got it! :-)

I extracted the relevant parts for my Needs from the modules directory etc.

greets