IF INLIST(Thisform.MyGrid.RowColChange,0,2) ; AND NOT ".INIT" $ PROGRAM(PROGRAM(-1)-1) ; AND NOT ".MOUSEDOWN" $ PROGRAM(PROGRAM(-1)-1) *** row hasn't changed and this method hasn't been called from THIS.Init() *** and this method hasn't been called from THIS.MouseDown() RETURN ENDIF Thisform.MyGrid.AllowCellSelection = SomeCondition IF NOT SomeCondition Thisform.MyGrid.SetAll("ReadOnly",.f.) ENDIFNow, add this line of code to the grid's MouseDown(), Init() and AfterRowColChange():
Thisform.DisableGridRows()