General information
Category:
Coding, syntax & commands
Title:
Container tab order in grid
Hi all,
I have a 1-column grid in a form. It uses a "dummy" cursor with two fields. The cursor is created in the Load method as follows:
****************************************
create cursor dummy_cursor (rowid I, other C(20))
* add two rows
for i=1 to 2
append blank
replace rowid with i
replace other with ' '
endfor
go top
****************************************
In the grid:s Init method I add two container objects (based on two user-defined container classes) to the column using the DynamicCurrentControl property. These containers are basically identical: they contain several objects (optiongroups, date fields, etc). The DynamicCurrentControl property is used because I want that when user is in the first row, the container "cont1" is available, and when user is in the second row, the container "cont2" is available:
****************************************
THIS.DeleteMark=.f.
THIS.Column1.Text1.Visible=.f.
THIS.Column1.Header1.Caption=''
THIS.Column1.Resizable=.f.
THIS.Column1.Movable=.f.
THIS.Column1.AddObject('cont1','ContainerOne')
THIS.Column1.AddObject('cont2','ContainerTwo')
THIS.Column1.DynamicCurrentControl = "iif(rowid=1,'cont1','cont2')"
THIS.Column1.Sparse=.f.
THIS.Column1.cont1.Enabled=.t.
THIS.Column1.cont2.Enabled=.t.
THIS.Column1.cont1.Visible=.t.
THIS.Column1.Header1.Caption=""
****************************************
But there is one problem: when I'm in the first row and use the "cont1" container, the TabOrder works fine - I can move from one field to another with TAB (or Enter) key. But when I move to the second row (and use the "cont2" container), the TabOrder doesn't work anymore: when I'm in the first field an press TAB or Enter key, the cursor just disappears somewhere. I have tried using the KeyPress event with no success.
Any suggestions?
Thanks in advance.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only