CREATE CURSOR DemoCursor (Id Int AUTOINC, Person Varchar(100)) INSERT INTO DemoCursor (Person) VALUES ("Joseph") INSERT INTO DemoCursor (Person) VALUES ("Mary") GO TOP LOCAL DemoForm AS CommandInGrid m.DemoForm = CREATEOBJECT("CommandInGrid") m.DemoForm.Show(1) DEFINE CLASS CommandInGrid AS Form ADD OBJECT MyGrid AS Grid PROCEDURE MyGrid.Init This.ColumnCount = 2 WITH This.Columns(2) .Sparse = .F. .RemoveObject("Text1") .AddObject("MyCommand", "MyCommand") .MyCommand.Visible = .T. .CurrentControl = "MyCommand" ENDWITH ENDPROC ENDDEFINE DEFINE CLASS MyCommand AS CommandButton Caption = "Click me!" PROCEDURE Click MESSAGEBOX(TEXTMERGE("Ouch! <<DemoCursor.Person>>!")) ENDPROC ENDDEFINE>Antonio,
>>with toGrid.columns(nColumn) >> .RemoveObject( "Text1" ) >> .AddObject( "MyCommand", "MyCommand" ) >> .MyCommand.Visible = .T. >> .CurrentControl = "MyCommand" >>endwith >>>>
>>>with toGrid.columns(nColumn) >>> .RemoveObject( "Text1" ) >>> .AddObject( "MyCommand", "MyCommand" ) >>> >>> **!! ERROR! >>> .CurrentControl = "cmdButton" && or "CommandButton" or "MyCommand" >>>>>>