toufik 2 Posted November 8, 2022 I'm new to using component TControlList can someone help with this How exactly can a selected field or item from the TControlList can be deleted? i'm loding the items like this procedure TForm1.ControlList1BeforeDrawItem(AIndex: Integer; ACanvas: TCanvas; ARect: TRect; AState: TOwnerDrawState); begin dm.fdmedcin.RecNo := AIndex+1; lbl5.Caption := 'Spc:' +TStringField( dm.fdmedcin.FieldByName('Spc_doc') ).AsString ; ......... ......... ........ procedure TDM.fdmedcinAfterOpen(DataSet: TDataSet); begin form1.ControlList1.ItemCount := fdmedcin.RecordCount; Share this post Link to post
toufik 2 Posted November 10, 2022 the answer is procedure TForm1.Delete; begin dm.fdmedcin.RecNo := ControlList1.ItemIndex + 1; // seems like you add one in your OnBeforeDrawItem too dm.fdmedcin.Delete; ControlList1.ItemCount := fdmedcin.RecordCount; end; Share this post Link to post