Dear all,
I've one question need to seek for help and I've attached picture to make to clear to understand.I'm using grid's style as '0' to allows for typed in data and insert methods by append items into combox list without assign cursor/alias into grid column's rowsource.
My problem is here where I type any item which is not contained in combox list and it would append in combobox and make a selection index in automatically. It suppose display its content after lostfocus when i switched focus to next column by pressing "Enter" button but it won't. FYI, i m using VFP 6.0 and I've done with troubleshooting by assign "boundto" to my grid's class as I take it from " but it is same.
Coding in Myform keypress's Event
do case
case nKeyCode = 13 => Respond for "Enter" Button
if _screen.activeform.activecontrol.name = "grid_list"
Nodefault
curcontrol = this.grid_list
curcolumn = curcontrol.activecolumn
do case
case curcolumn = 9 => Column 'UOM' where it is
local vl_ret1stcur
vl_ret1stcur = .f.
selindex = 1
for count_ = 1 to this.grid_list.columns(9).com_uom.listcount - 1
if alltrim(this.grid_list.columns(9).com_uom.list(count_)) == ;
alltrim(this.grid_list.columns(9).com_uom.displayvalue)
vl_ret1stcur = .t.
selindex = count_
endif
next
if vl_ret1stcur = .f. => Responsible add into list if not item found on combox list
this.grid_list.columns(9).com_uom.addlistitem( ;
alltrim(this.grid_list.columns(9).com_uom.displayvalue), ;
this.grid_list.columns(9).com_uom.newitemid + 1)
lstitemid = this.grid_list.columns(9).com_uom.listcount=> Pick the selection index
else
lstitemid = selindex
endif
this.grid_list.columns(9).com_uom.displayvalue = ;
this.grid_list.columns(9).com_uom.list(lstitemid)
curcontrol.columns(16).com_gl.setfocus()
curcontrol.columns(10).setfocus() => setfocus on next column
curcontrol.columns(10).text1.selstart = 0
return
endcase
Coding in my grid's class
Define class com_bund as combobox
style = 0
boundto = .t. => This things won't worked for me.
procedure click
this.parent.parent.columns(16).com_gl.setfocus()
this.parent.parent.columns(10).setfocus()
this.parent.parent.columns(10).text1.selstart = 0
endpro
procedure init => Using insert methods without assign rowsource here
this.clear()
this.addlistitem(SPACE(7),this.newitemid + 1)
sele uom_
go top
do while !EOF()
this.addlistitem(alltrim(uom),this.newitemid+1)
skip
enddo
this.refresh()
endpro
enddefine
Appreciate thanks to any helps.
I've one question need to seek for help and I've attached picture to make to clear to understand.I'm using grid's style as '0' to allows for typed in data and insert methods by append items into combox list without assign cursor/alias into grid column's rowsource.
My problem is here where I type any item which is not contained in combox list and it would append in combobox and make a selection index in automatically. It suppose display its content after lostfocus when i switched focus to next column by pressing "Enter" button but it won't. FYI, i m using VFP 6.0 and I've done with troubleshooting by assign "boundto" to my grid's class as I take it from " but it is same.
Coding in Myform keypress's Event
do case
case nKeyCode = 13 => Respond for "Enter" Button
if _screen.activeform.activecontrol.name = "grid_list"
Nodefault
curcontrol = this.grid_list
curcolumn = curcontrol.activecolumn
do case
case curcolumn = 9 => Column 'UOM' where it is
local vl_ret1stcur
vl_ret1stcur = .f.
selindex = 1
for count_ = 1 to this.grid_list.columns(9).com_uom.listcount - 1
if alltrim(this.grid_list.columns(9).com_uom.list(count_)) == ;
alltrim(this.grid_list.columns(9).com_uom.displayvalue)
vl_ret1stcur = .t.
selindex = count_
endif
next
if vl_ret1stcur = .f. => Responsible add into list if not item found on combox list
this.grid_list.columns(9).com_uom.addlistitem( ;
alltrim(this.grid_list.columns(9).com_uom.displayvalue), ;
this.grid_list.columns(9).com_uom.newitemid + 1)
lstitemid = this.grid_list.columns(9).com_uom.listcount=> Pick the selection index
else
lstitemid = selindex
endif
this.grid_list.columns(9).com_uom.displayvalue = ;
this.grid_list.columns(9).com_uom.list(lstitemid)
curcontrol.columns(16).com_gl.setfocus()
curcontrol.columns(10).setfocus() => setfocus on next column
curcontrol.columns(10).text1.selstart = 0
return
endcase
Coding in my grid's class
Define class com_bund as combobox
style = 0
boundto = .t. => This things won't worked for me.
procedure click
this.parent.parent.columns(16).com_gl.setfocus()
this.parent.parent.columns(10).setfocus()
this.parent.parent.columns(10).text1.selstart = 0
endpro
procedure init => Using insert methods without assign rowsource here
this.clear()
this.addlistitem(SPACE(7),this.newitemid + 1)
sele uom_
go top
do while !EOF()
this.addlistitem(alltrim(uom),this.newitemid+1)
skip
enddo
this.refresh()
endpro
enddefine
Appreciate thanks to any helps.