RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TValueListEditor.OnGetEditText Event

Occurs when the in-place editor requests the value of a cell.

Pascal
property OnGetEditText: TGetEditEvent;
C++
__property TGetEditEvent OnGetEditText;

Write an OnGetEditText event handler to provide the in-place editor with a string representing the contents of the cell. Set the Value parameter to the string for the cell specified by the ACol and ARow parameters. When the cell enters edit mode, the contents of the cell are drawn as the Value string returned by the OnGetEditText event handler. This image need not match the appearance of the cell when it is not in edit mode, which is drawn using the OnDrawCell event handler. 

OnGetEditText does not occur unless the Options property includes goEditing.  

Delphi Examples: 

 

{
The following code lowercases the text for a string grid
cell when the user begins to edit it.
} 
procedure TForm1.StringGrid1GetEditText(Sender: TObject; ACol, ARow: Longint; var Value: string);
begin
  Value := AnsiLowerCase(Value);
end;

 

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