oForm = CreateObject('myForm') oForm.Show Read events Define Class myForm As Form DataSession = 2 Top = 0 Left = 0 Height = 271 Width = 411 DoCreate = .T. Caption = "Combo test" Name = "frmMyForm" Dimension arrItems[1] Add Object combo1 As ComboBox With ; BoundColumn = 2, ; ColumnCount = (Alen(Thisform.arrItems,2)), ; RowSourceType = 5, ; RowSource = "thisform.arrItems", ; ControlSource = "table1.lookupid", ; FirstElement = 1, ; Height = 24, ; Left = 36, ; NumberOfElements = (Alen(Thisform.arrItems)), ; Style = 2, ; Top = 12, ; Width = 144, ; BoundTo = .T., ; Name = "Combo1" Add Object grid1 As Grid With ; Height = 200, ; Left = 36, ; Top = 48, ; Width = 320, ; Name = "Grid1" Procedure Load Create Cursor Table1 (Id i, lookupid i) For ix = 1 To 100 Insert Into Table1 Values (ix, Rand()*1000) EndFor locate Select 'Item_'+Transform(lookupid), lookupid ; from Table1 ; into Array This.arrItems EndProc Procedure Init * this.combo1.NumberOfElements = Alen(This.arrItems) EndProc Procedure grid1.AfterRowColChange Lparameters nColIndex Thisform.Refresh EndProc Procedure QueryUnload Clear events endproc EnddefineCetin