ListViewItem with progress bar not refreshing correctly

0
0

I have a listview that uses a progress bar (pb1.png). There is a timer that refreshes the list (lvDisk) every 1 minute. After several minutes the list will not show the progress bars (pb2.png, but will show the .text

Me.lvDisk.Items.Clear()
For Each dRow In tmpDistinct
Dim itm As New ListViewItem
itm.Text = dRow

Dim pb As New Wisej.Web.ProgressBar
With pb
.Maximum = tmpUNCData.First.DriveSpace
.Value = tmpUNCData.First.UsedSpace
.Dock = DockStyle.Fill
.Text = drow.name

If percentUsed > 95 Then
.BarColor = Drawing.Color.Yellow
Else
.BarColor = Drawing.Color.Green
End If

End With

itm.Control() = pb
next

Me.lvDisk.Items.Add(itm)

The first image is what draws initially, the second is what shows after a while (again, sometimes it is several minutes, sometimes longer)

If I take out the line itm.Text = dRow, then it appears to always refresh with the progress bar

Attachment
  • Shawn Ramirez
    I was wrong, if itm.Text is not there, after around 20 timer ticks, the progress bars do not show. Only the Column Name shows. No progress bars
  • You must to post comments
0
0

Hi Shawn,

WJ-8597 is fixed in dev build 1.4.53.

Best regards
Frank

  • You must to post comments
1
0

Hi Shawn,

we fixed the problem with disposed controls bound to ListView items (logged as WJ-8597) and the fix will be included in the next Wisej build.

However in your scenario we recommend to precreate the items and progress bars and then just set the value instead of destroying and recreating everything on each tick.

We´ll inform you when the new release is online.

Best regards
Frank

  • You must to post comments
0
0

Can you send a small test case? The code in the message seems to indicate that on every tick the controls are recreated but never disposed.

  • Luca (ITG)
    No need for sample, I can reproduce in Details view.
  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.