TAdvOfficeCheckGroup is way too slow

Hey,
I tried to use a TAdvOfficeCheckGroup to load about 150 Check Items.

Loading the list from a simple stringlist needs 210,031 milliseconds -> 3 Minutes and 30 Seconds!

So, after the list is loaded, I wanted to set some checks at the items.
Every check forces a redraw of the complete list. This is very terrible slow!

I won't think on lists, that contain more than 150 Items.
Please, fix this.

Thanks in advance
Ollo

I tested this with a default TAdvOfficeCheckGroup with code:

procedure TForm1.Button1Click(Sender: TObject);
var
i: integer;
t: dword;
begin
t := gettickcount;
AdvOfficeCheckGroup1.Items.BeginUpdate;
for i := 0 to 150 do
begin
AdvOfficeCheckGroup1.Items.Add('item '+inttostr(i));
end;
AdvOfficeCheckGroup1.Items.EndUpdate;

caption := (gettickcount - t).ToString;
end;

and this executes here in 125ms

Please have a look at this.

... Please also note, that I complained the redraw behavior.

procedure TfrmMain.btnTool3Click(Sender: TObject);
var
  tick: Cardinal;
  sltM,
  sltW: TStrings;
  itms: TStrings;
  s:    string;
begin
  lblState.Caption := 'Start...   ';
  lblState.Update;

  sltM := TStringList.Create;
  sltW := TStringList.Create;
  try
    LoadResourceToStrings('VORNAMEN_WEIBLICH',  'CSV', sltW);
    LoadResourceToStrings('VORNAMEN_MAENNLICH', 'CSV', sltM);

    var c: Integer := sltM.Count;
    if sltW.Count < c then c := sltW.Count;
//  c := 150;
    Dec(c);

    s := '';
    for var x := 0 to 1 do
    begin
      case x of
        0: itms := chkgrp.Items;  // TAdvOfficeCheckGroup
        1: itms := clb.Items;     // Delphi TCecklistBox
      end;

      tick := GetTickCount;

      itms.Clear;
      itms.BeginUpdate;
      try
        for var i: Integer := 0 to c do
          itms.Add(sltW[i] + ' ' + sltM[i]);
      finally
        itms.EndUpdate;
      end;

      s := s + #13#10 + 'Count: ' + itms.Count.ToString + '  Ready: ' + (GetTickCount - tick).ToString + '   ';
    end;
  finally
    sltM.Free;
    sltW.Free;

    lblState.Caption := s;
    lblState.Update;
  end;
end;

A quick solution is to set AdvOfficeCheckGroup.DoubleBuffered = true

A quick solution for... what?

No solution for anything :frowning:

To be honest, I don't know, what disappoints me more. The component, that doesn't work, or the support for the component.

I told you, that the component is slow, I demonstrated a benchmark compared to a native delphi component. I posted a screen shot, that shows your component, that doesn't display the checkboxes. I also posted source code.

I only get poor one line answers.

If I cannot reproduce your problem, I cannot magically come up with a solution for a problem I cannot see.
Send a sample source project that I can compile and run here and with which I can identify the problem.
And your statement about "one line answers" is false. I did the effort to come up with code myself to test what I assume you were doing and my code runs in 125ms.

Please have a look at the ZIP file. It contains a sample project.

ADV Checklist.zip (82.1 KB)

In your initial post, you referred to 150 items, in this sample now it is 2481 items.
TAdvOfficeCheckGroup is not designed to be used this way. TAdvOfficeCheckGroup is a groupbox control that creates TAdvOfficeCheckBoxes for every item on the groupbox. Adding 2481 UI controls on a form is not a good idea and too Windows resource intensive.
The VCL TCheckListBox is created in a different way with a different purpose.
If you need an alternative for TCheckListBox, you could use a TAdvStringGrid with checkboxes added to cells. This can easily handle multiple thousands of cells.

OK, I understand. So I compared apples with pears.
Thanks, for your answer.

Nevertheless there is probably a bug in your component. Why can't I see the checkboxes?

Similar to a TGroupBox, it doesn't have a scrollbar, it results in "compressing" all controls on the available height. You'll see that if you decrease the nr. of items.