type
TMyGrid = class(TStringgrid);
//TMyGrid中将会有MoveRow函数,可以使用此函数移动行,然后进行删除,具体代码如下
procedure TFMMain.N1Click(Sender: TObject);
variRow : Integer;
begin
if strngrdResult.Selection.Top > 0 then
begin
iRow := strngrdResult.RowCount;
TMyGrid(strngrdResult).MoveRow(RowCount,strngrdResult.RowCount - 1);
strngrdResult.Rows[strngrdResult.RowCount - 1].Clear;
strngrdResult.RowCount := iRow - 1;
end;
end;