I have a grid with 2 columns. The second columns has next the default Textbox1 the controls txtNum and txtChar and cmbJaNee. The following setting for the grid:
table: aTable
columns: type n(2); num_value n(10); char_value c(100)
grid.recordSource = [aTable]
grd.columns(2).bound = .f.
grd.columns(2).controlSource = [(iif(aTable.type=1,alltrim(str(aTable.num_value)),iif(aTable.type=2,aTable.char_value,iif(aTable.num_value=1,'YES','NO'))))]
grd.columns(2).txtNum.controlSource = [aTable.num_value]
grd.columns(2).txtChar.controlSource = [aTable.char_value]
grd.columns(2).cmbJaNee.controlSource = [aTable.num_value]
grd.columns(2).cmbJaNee.rowSourceType = 1
grd.columns(2).cmbJaNee.rowSource = 'YES,NO'
grd.columns(2).dynamicCurrentControl = [(iif(aTable.type=1,'txtNum',iif(aTable.type=2,'txtChar','cmbYesNo')))]
Now when clicking column 2 for a numeric value, the focus goes from txtNum out of the grid to the next control. When tabbing to column 2 the focus stays on txtNum display value X. Editting is not possible.
Now when clicking column 2 for a character value, the focus stays on txtChar display empty. Editting is not possible.
Now when clicking column 2 for a Yes/No value, the combo is displayed and I can make a selection.
Now why does the cmbYesNo work, and txtNum and txtCahr does not work?
How can I make txtNum and txtChar editting?
Gr,
André
table: aTable
columns: type n(2); num_value n(10); char_value c(100)
grid.recordSource = [aTable]
grd.columns(2).bound = .f.
grd.columns(2).controlSource = [(iif(aTable.type=1,alltrim(str(aTable.num_value)),iif(aTable.type=2,aTable.char_value,iif(aTable.num_value=1,'YES','NO'))))]
grd.columns(2).txtNum.controlSource = [aTable.num_value]
grd.columns(2).txtChar.controlSource = [aTable.char_value]
grd.columns(2).cmbJaNee.controlSource = [aTable.num_value]
grd.columns(2).cmbJaNee.rowSourceType = 1
grd.columns(2).cmbJaNee.rowSource = 'YES,NO'
grd.columns(2).dynamicCurrentControl = [(iif(aTable.type=1,'txtNum',iif(aTable.type=2,'txtChar','cmbYesNo')))]
Now when clicking column 2 for a numeric value, the focus goes from txtNum out of the grid to the next control. When tabbing to column 2 the focus stays on txtNum display value X. Editting is not possible.
Now when clicking column 2 for a character value, the focus stays on txtChar display empty. Editting is not possible.
Now when clicking column 2 for a Yes/No value, the combo is displayed and I can make a selection.
Now why does the cmbYesNo work, and txtNum and txtCahr does not work?
How can I make txtNum and txtChar editting?
Gr,
André