DIMENSION aDummy[26] FOR jx=1 to 26 aDummy[jx] = replicate(chr(asc("A")-1+jx),10) ENDFOR oForm = createobject("myform") oForm.show READ events DEFINE class myform as form PROCEDURE init CREATE cursor mycursor (CtrlType i, Somefield i) FOR ix = 1 to 20 INSERT into mycursor ; (CtrlType) values (ix%4) ENDFOR GO top WITH this .height = 400 .closable = .f. .addobject("grid1","mygrid") .addobject("myQuit1","myQuit") .grid1.top = .myQuit1.top + .myQuit1.height + 5 .grid1.height = .height - (.grid1.top + 5) .grid1.visible = .t. .myQuit1.visible = .t. .width = .grid1.width + .grid1.left + 5 ENDWITH ENDPROC PROCEDURE getcontrol LPARAMETERS lnType DO case CASE lnType = 1 RETURN "Check1" CASE lnType = 2 RETURN "Combo1" CASE lnType = 3 RETURN "Options1" OTHERWISE RETURN "text1" ENDCASE ENDDEFINE DEFINE class mygrid as grid PROCEDURE init WITH this .recordsource = "myCursor" .rowheight = 50 WITH .columns(2) .addobject("Check1","Checkbox") .Check1.caption = "" .Check1.visible = .t. .addobject("Combo1","MyCombobox") .Combo1.visible = .t. .addobject("Options1","MyOptionGroup") .Options1.visible = .t. .dynamiccurrentcontrol = "thisform.getcontrol(myCursor.ctrltype)" .currentcontrol = "Text1" && This is default control also .sparse = .f. && Show control while column doesn't have focus ENDWITH ENDWITH ENDDEFINE DEFINE class MyComboBox as Combobox ColumnCount = (ALEN(aDummy,2)) RowSourceType = 5 RowSource = "aDummy" FirstElement = 1 Height = 24 NumberOfElements = (ALEN(aDummy)) Style = 2 Width = 100 Name = "Combo1" ENDDEFINE DEFINE CLASS MyOptionGroup AS optiongroup AutoSize = .T. ButtonCount = 2 Value = 1 Height = 46 Width = 77 Name = "Optiongroup1" Option1.Caption = "Choice 1" Option1.Value = 1 Option1.Height = 17 Option1.Left = 5 Option1.Top = 5 Option1.AutoSize = .T. Option1.Name = "Option1" Option2.Caption = "choice 2" Option2.Height = 17 Option2.Left = 5 Option2.Top = 24 Option2.AutoSize = .T. Option2.Name = "Option2" ENDDEFINE DEFINE class myquit as commandbutton Left=1 Top=0 AutoSize = .T. Caption="Close" PROCEDURE click Release all Clear events ENDPROC ENDDEFINENow for second part, the beforerowcolchange code here was partial code from my class. Just before the code a check is done if it's a rowchange or not and this part is surrounded with a "if llChangingRow..endif". If llChangingRow (a rowchange detected) then nColIndex refers to column index.