I have a WinGrid with a progressbar as the column for downloading files in each row of the grid. At the end of the downloads, the values of row 1 in the progress bar is 50%, row 2 is 69% and row 3 (the last download) is 100% - why are the values of row 1 and row 2 changing even though they stay at 100% throughout the downloads - it is only at the end are those values changed for some reason.
See attached screenshot.
Thanks
Scott
Hi Scott,
I'm no sure what you are asking. The grid has no control over the values of the cells changing. Something in your code must be changing those values either via the grid cell or the data source field value.
I'm afraid I cannot possibly guess what your code is doing to change the values of the cells in the grid without more information about what your code is doing. Perhaps you could post a small sample project demonstrating what you are doing and the result?
I am not changing the cell values - its almost like when I minimize and maximize the form, the grid is refreshing incorrectly. In terms of code, basically I have a single UltraProgressBar as the EditorComponent for that column and I set the current row being downloaded and I am updating the UltraProgressBar for that row while it is being downloaded and then moving on to the next row.
I'm not sure I am following you. You are never changing the cell values? Then how are you expecting the ProgressBar to update?
Remember that if you have a ProgressBar or any editor assigned to a column, that the editor services the entire column. Therefore, you should not be setting the Value of the ProgressBar, and doing so will have no effect on the grid. The progress bar value in each cell of the grid comes from the grid cell, not the editor. It cannot come from the editor since the editor has only a single value.
If this is indeed a refreshing issue of some kind, then simply moving the mouse over the cells would cause the issue to correct itself for that cell. Does that happen in this case?
slezberg said: Since rowCurrentRowDownload is the current row in the UltraGrid, doesn't this set the value of the cell in the grid like you suggest? rowCurrentRowDownload.Cells("ProgressBar").Value = val2
Since rowCurrentRowDownload is the current row in the UltraGrid, doesn't this set the value of the cell in the grid like you suggest?
rowCurrentRowDownload.Cells("ProgressBar").Value = val2
Yes, that is the correct way to do it.
slezberg said:I have 1 UltraProgressBar control on the form and the grid column references that single control in each grid row. Is that the correct way?
Yes, that's correct, also.
slezberg said:Can we do a call/livemeeting so we can discuss further? I can be reached at ScottLezberg@deltek.com if you can.
If you can post a small sample project, I'd be happy to check it out. But if you need to speak to someone directly, you will need to contact Developer Support. If you like, I can forward this thread over to them and have them start a case for you. I suspect they will probably need to see a sample, anyway, though.
I have 1 UltraProgressBar control on the form and the grid column references that single control in each grid row. Is that the correct way?
Can we do a call/livemeeting so we can discuss further? I can be reached at ScottLezberg@deltek.com if you can.
slezberg said:rowCurrentRowDownload = rowUltraProgressBar1.Minimum = 0 UltraProgressBar1.Maximum = 100
This does not make sense. The Minimum, Maximum, and Value of the UltraProgressBar are irrelevant. These properties cannot be used, because as I said, the ProgressBar (or any editor) services the entire grid column.
You need to use the MinValue and MaxValue on the grid column, and the value of the grid cell to control the ProgressBar in a cell of the grid.
Are you using a different ProgressBar control for each cell in the column? That would be very inefficient and unnecessary. You can use a single ProgressBar for the entire column.
Basically, I am going through each row in the grid and setting the UltraProgressBar to the current row column called ProgressBar and doing a background download so it looks like a common download manager where it downloads a file and shows the progress from 0 to 100% and then goes to the next row in the grid and downloads the file and shows the progress, etc. and it looks correct as long as you dont move the form or minimize/maximize, etc. - its like its refreshing that column with random values.
rowCurrentRowDownload = rowUltraProgressBar1.Minimum = 0 UltraProgressBar1.Maximum = 100
And then during the download for the row of the grid, I am updating the ProgressBar value with the following so I believe I am setting the value of the cell and not the UltraProgressBar editor.
No it does not correct itself when I move the mouse over the cells.