RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TValueListEditor.OnRowMoved Event

Occurs immediately after the position of a row changes.

Pascal
property OnRowMoved: TMovedEvent;
C++
__property TMovedEvent OnRowMoved;

Write an OnRowMoved event handler to provide special processing whenever a row in the grid changes position. Rows can be moved programmatically or by user manipulation. OnRowMoved does not occur unless the Options property includes goRowMoving.  

Delphi Examples: 

 

{
The following code displays the number of rows a row was
moved in a label.  To move rows in a TStringGrid, goRowMoving
must be included in the Options property.
} 
procedure TForm1.StringGrid1RowMoved(Sender: TObject; FromIndex, ToIndex: Longint);
begin
  Label1.Caption := IntToStr(Abs(FromIndex-ToIndex));
end;

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!