Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Progressbar in a grid
Message
 
 
To
03/04/2002 12:48:52
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00640433
Message ID:
00640473
Views:
13
>I am attempting to include a progressbar in one of the cells on a grid but I'm having trouble getting the progressbar to display the correct value for the record corresponding to that row.
>
>As I change the value of the progress field for a particular record/row all of the rows are getting the same progress indication. The effect is that all rows appear to advance at the same rate, even though only one record may actually be changing. Obviously, I want the progressbar for each record/row to behave independantly.
>
>The progress column includes a couple of objects. 1. A textbox whose controlsource is tied to a field in the table, whose value corresponds to the percentage complete. 2. a container that contains a shape for the progress bar itself and a label to display the value for the completion percentage.
>
>The container is selected as the currentcontrol for the column.
>
>In the programmaticchange event for the textbox I have code that updates the width of the shape and label based on changes to the value of the progress field in my table.
>
>I temporarily setup a timer to artifically increment the value of the progress field for the first record in my table so that I could observe the progress bar change.
>
>As I said though, when I update the value for the first record all rows in my grid are showing the same progress rate even though I am only changing any values for the first record in my table.

In order to show it properly you have to use one of the Dynamic properties for the grid's column, say, DynamicBackColor. Set it to DynamicBackColor = 'thisform.myFunction(MyTable.myFieldVal)'
In this form's (or grid) function you can update and refresh controls as you need. Don't forget to return a color from this function.

Anyway, I guess, this technique would be slow. Do you really need to use ProgressBar in the column? Can you place it just on the form (outside the grid)?
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform