Setting the goAlwaysShowEditor option does put the grid in edit mode as
long as there is no data in the focused cell. But if there is data, it
becomes selected forcing the user to press F2 or Enter to edit the data.
I would really like to be able to force it into edit mode when a new
cell is selected.
I tried using:
StringGrid1.EditorMode := True;
which doesn't do the trick
Thanks for anyhelp,
Mitch Godfrey
Day 1 Software
To do this, you need to get at the protected InplaceEditor property. This
can be done by creating a "cracker" descendant (descendant classes are
allowed to access protected properties and methods):
type
TCrackerGrid = class(TStringGrid);
In your grid's OnSelectCell method, just post a Windows message to the
InplaceEditor to turn off the selection:
procedure TForm1.StringGrid1SelectCell(Sender: TObject; ACol,
ARow: Integer; var CanSelect: Boolean);
begin
PostMessage(TCrackerGrid(StringGrid1).InplaceEditor.Handle, em_SetSel, -1,
0);
end;
--
Wayne Niddery - WinWright Consulting
Delphi, C++Builder, JBuilder, InterDev --
http://home.ican.net/~wniddery/RADBooks.html
...remove chaff when replying...
"You know you've landed gear-up when it takes full power to taxi"
That looks fun, I'll give it a whirl.