Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
315
UltraProgressBar in an UltraGrid
posted

I realize that you can place a UltraProgressBar on a form and then set the EditorControl property for the column in the grid to that control.  What I can't figure out is how to set the maximum value for each row's progress bar to be different.  I have a process that runs a series of tasks.  I have each task being listed in its own row in the grid.  At the beginning of each task I determine how many steps I have to do and then I set the MaxValue property of that progress bar in that task's row to be that number of steps. ie)

Me.ugProgress.Rows(task).Cells("SyncProgress").Column.MinValue = 0

Me.ugProgress.Rows(task).Cells("SyncProgress").Column.MaxValue = stepCount

Then as I am going through each task I update the value of the progress bar in that row to track the progress.  ie)

Me.ugProgress.Rows(task).Cells("SyncProgress").Value += 1

The problem I am running into in doing this is that the MaxValue property of the other rows seem to be getting reset as I am going down my task list to the MaxValue of the task that I am currently on.  So if my last task contains zero steps, all of the other progress bar's MaxValues for the previous steps I have completed get set back to zero as well.  The end result is that my previous tasks which were at 100% now get set to 0% complete. 

Is the grid only using one instance of this control for all rows or does it make a copy of the progress bar for each row?  If it uses only one instance how do I get each row to show and keeps it's own independant value?

Thanks

  • 469350
    Verified Answer
    Offline posted

     The Column property on the cell is a backward pointer to the column. Each cell doesn't have it's own column, the column is on the Band and applies to all of the cells. 

    Why don't you simply set the MinValue to 0 and the MaxValue to 100 and represent the value in the cell as a percentage? You could even use an unbound column to store the real step value and another one to store the number of steps, then use InitializeRow to set the ProgressBar column's value.