Topic: What is the Checkbox in TableGrid ?

Hi,
Any one know what is usage of #Checkbox in TableGrid settings ?

I know make multi selectable of rows, I try used as delete multi rows in one click but not working for me.

Please share any successful idea. Plus if you know what is the language used for 3. Filter
 

https://i.ibb.co/HH805TY/Checkbox.png

Life is like a school;
One can learn and graduate or stay behind.

Re: What is the Checkbox in TableGrid ?

for i:=0 to frmMain.tgCurrentOffersClient.RowCount-1 do
    begin
      if (frmMain.tgCurrentOffersClient.Cell[0,j].AsBoolean = True) then
      begin
        SQLExecute('DELETE FROM numberApproved WHERE id='+IntToStr(frmMain.tgCurrentOffersClient.Row[j].ID));
      end;
   end;

Re: What is the Checkbox in TableGrid ?

Thanks sibprogsistem
I do it by your code with small modification

procedure Form1_Button_Delete_OnClick (Sender: TObject; var Cancel: boolean);
var i : integer;
begin
    For i:= 0 to Form1.TableGrid1.RowCount -1 do
    Begin
    If (Form1.TableGrid1.Cell[0,i].AsBoolean = True) then
        Begin
        SQLExecute('Delete FROM Data Where id=' +IntToStr(Form1.TableGrid1.Row[i].ID));
        End;
    End;
    Form1.TableGrid1.dbUpdate;
end;
Post's attachments

Attachment icon Delete MultiSelect Table.zip 4.83 kb, 161 downloads since 2022-02-27 

Life is like a school;
One can learn and graduate or stay behind.

Re: What is the Checkbox in TableGrid ?

OK

Re: What is the Checkbox in TableGrid ?

and to export the selected ones to excel?

Domebil

Re: What is the Checkbox in TableGrid ?

Hi Domebil,
Probably a few ways to do it.
You could try it like this (see attachment:  please note that this is currently set up to export to OpenOffice(Calc) so if you are using Excel, you will need to re-configure Form1.Button5).
Derek.

Post's attachments

Attachment icon exportselectedrows.zip 338.13 kb, 191 downloads since 2022-02-27 

Re: What is the Checkbox in TableGrid ?

Thank you very much Derek.!

Domebil