Description


Occurs when the user has moved a row to a new position. Allows you to cancel the move.


The parameters of this event include the Accept parameter, which allows you to cancel the move of the row.



Example


// prohibit moving the first line to the very end
procedure Form1_TableGrid1_OnRowMove (Sender: TObject; FromPos, ToPos: Integer; var Accept: Boolean);
begin
    if (FromPos=0) and (ToPos = Form1.TableGrid1.RowCount-1) then
    begin
        Accept := False;
        ShowMessage('You cannot move the first line to the end.');
    end;
end;