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
230
Can we change the maximum value in ultraprogressbar through a loop
posted

Hi,

I m displaying a ultraprogressbar in a Ultragrid cell.My problem is that the progress bar depends on data from other column of grid.The maximum property of ultraprogress bar should be assigned a value through loop.i.e. i wish to assign different value to maximum when looping through each row of grid.

My code is

For Each row In UltraGrid1.Rows

row.Cells("Percentage").Value = (row.Cells("Planned Hours").Value - row.Cells("Remained Hours").Value)

UltraProgressBar1.Maximum = row.Cells("Planned Hours").Value

Next

But here the maximum takes the last value in the loop.But I need to assign a different value at each iteration of the loop.Is it possible???????

Please Help me...................

Parents
No Data
Reply
  • 17259
    Offline posted

    You need to create a different progress bar for each cell.

    Change this:

    UltraProgressBar1.Maximum = row.Cells("Planned Hours").Value

    To:

    UltraProgressBar bar = new UltraProgressBar()

    bar.Maximum = row.Cells("Planned Hours").Value

    row.Cells("Percentage").EditorControl = bar

    Two more tips:

    1. Don't enumerate rows. Use InitializeRow event and get the row from e.Row. Thsi event occurs also when a cell value is changed.

    2. Set the progress bar text to "[Value] / [Maximum]"

Children