rzaripov1990 / ModernListView

[FireMonkey] Modern ListView - Colorizer, Vertical\Horizontal mode, Columns and other
120 stars 41 forks source link

uForm3.pas (Column Mode) : ReloadLV #9

Closed ChloeDigitalTechnologies closed 7 years ago

ChloeDigitalTechnologies commented 7 years ago

Instead of :

procedure TForm3.ReLoadLV; var J, realIndex, ColumnInRow, RowCount: Integer; AItem: TListViewItem; iBitmap: TListItemImage; begin ListView1.OnPaint := nil; [...................... Code ..............................] ListView1.OnPaint := ListView1Paint; end;

Enclose the code with BeginUpdate/EndUpdate, and finish with Repaint, like this :

procedure TForm3.ReLoadLV; var J, realIndex, ColumnInRow, RowCount: Integer; AItem: TListViewItem; iBitmap: TListItemImage; begin ListView1.BeginUpdate; [...................... Code ..............................] ListView1.OnPaint := ListView1Paint; ListView1.EndUpdate; ListView1.Repaint; end;

rzaripov1990 commented 7 years ago

thanks, fixed

ChloeDigitalTechnologies commented 7 years ago

I was wondering : I am not sure if the Repaint method is calles by EndUpdate or not (I think it is not, that's why I recommend to use it at the end)