smoothlistbox and collapse

hi i'm using smoothlistbox to show data on 2 level but i want 2nd level is collapsed and when i click on first level to expand this. My code is :


While Not DMC.mtAvvisi.Eof Do Begin

level 1 or master :

    With lbxAvv.Items.Add Do Begin
      Caption:='<br>'+DMC.mtAvvisi.FieldByName('Desc_Avv').AsString+'<br><br>';

      // NB : non impostarli a livello di DefaulItem altrim li fa anche sul livello 2 di dettaglio
      GraphicLeftType:=gtSmoothButton;
      ButtonCaption:='Dett.';
      ButtonBevelColor:=clBlack;
      ButtonColor:=clGreen;
      GraphicLeftWidth:=40;
    End;

level 2 :

    With lbxAvv.Items.Add Do Begin
      Level:=1;
      Caption:=DMC.mtAvvisi.FieldByName('Dett_Avv').AsString;
      //Expanded:=False;
      Collapse();  // non funz
    End;

BUT collapse dont go ! always i see 2nd level expanded !

Thank u. BYE



Hi, 


Please first, add all items with a BeginUpdate/EndUpdate and then afterwards collapse/expand the correct items.