using dbgrid may be easy with deleterow command, but you know in string grid does not have that command. and now with this little function can delete current row or selected row.
enjoyed!..
procedure DeleteCurrentRow(Grid: TStringGrid); var i: Integer; begin for i := Grid.Row to Grid.RowCount - 2 do Grid.Rows[i].Assign(Grid.Rows[i + 1]); Grid.RowCount := Grid.RowCount - 1; end; procedure TfrmDoAbsen.StringGrid1DblClick(Sender: TObject); begin DeleteCurrentRow(StringGrid1); end;example i have table string grid with double click i'll delete it current row :
so for result :
0 Response to "Deleting a selected row via another click in TStringGrid using delphi"
Post a Comment