GRID DynamicInputMask
Hola quisiera que me ayudes tengo un problema con el grid, le agregue objetos textbox para poderlos modificar en este caso los colores, pero mi problema es que no se aplica ni el format para la columna, ni el DynamicInputMask y lo que yo quiero es a la columna2 ponerle un formato predeterminado.
create cursor cur1 (f1 c(5), f2 i,f3 n(20,2),f4 n(20,2))
insert into cur1 values ('xxx',1,1,2999.90123)
insert into cur1 values ('yyy',2,2,0)
insert into cur1 values ('zzz',3,3,23.234)
go top
public oform1
oform1=createobject("form1x")
oform1.show
return
define class form1x as form
autocenter = .t.
caption = "form1"
name = "form1"
add object gridpr as grid with ;
columncount = 2, ;
left = 12, ;
recordsource = "cur1", ;
recordsourcetype = 1, ;
top = 12, ;
name = "gridpr", ;
column1.controlsource = "cur1.f3", ;
column2.controlsource = "cur1.f4"
proc init
thisform.gridpr.column2.removeobject('text1')
thisform.gridpr.column2.addobject('text2','textboxx')
thisform.gridpr.column2.text2.visible = .t.
thisform.gridpr.column2.addobject('text3','textboxy')
thisform.gridpr.column2.text3.visible = .t.
thisform.gridpr.column2.sparse = .f.
thisform.gridpr.column2.bound = .t.
thisform.gridpr.column2.enabled = .t.
thisform.gridpr.column2.readonly = .f.
* thisform.gridpr.column2.format='@ 9,999.99'
thisform.gridpr.column2.dynamiccurrentcontrol = "iif(cur1.f3=2, 'text3', 'text2')"
thisform.gridpr.column2.dynamicinputmask = "@r$ ###,###,###.##" &&Problema
endproc
procedure destroy
use in cur1
endproc
enddefine
define class textboxx as textbox
borderstyle = 0
enddefine
define class textboxy as textbox
borderstyle = 0
forecolor = rgb(255,255,255)
selectedforecolor = rgb(255,255,255)
selectedbackcolor = rgb(255,255,255)
enddefine
create cursor cur1 (f1 c(5), f2 i,f3 n(20,2),f4 n(20,2))
insert into cur1 values ('xxx',1,1,2999.90123)
insert into cur1 values ('yyy',2,2,0)
insert into cur1 values ('zzz',3,3,23.234)
go top
public oform1
oform1=createobject("form1x")
oform1.show
return
define class form1x as form
autocenter = .t.
caption = "form1"
name = "form1"
add object gridpr as grid with ;
columncount = 2, ;
left = 12, ;
recordsource = "cur1", ;
recordsourcetype = 1, ;
top = 12, ;
name = "gridpr", ;
column1.controlsource = "cur1.f3", ;
column2.controlsource = "cur1.f4"
proc init
thisform.gridpr.column2.removeobject('text1')
thisform.gridpr.column2.addobject('text2','textboxx')
thisform.gridpr.column2.text2.visible = .t.
thisform.gridpr.column2.addobject('text3','textboxy')
thisform.gridpr.column2.text3.visible = .t.
thisform.gridpr.column2.sparse = .f.
thisform.gridpr.column2.bound = .t.
thisform.gridpr.column2.enabled = .t.
thisform.gridpr.column2.readonly = .f.
* thisform.gridpr.column2.format='@ 9,999.99'
thisform.gridpr.column2.dynamiccurrentcontrol = "iif(cur1.f3=2, 'text3', 'text2')"
thisform.gridpr.column2.dynamicinputmask = "@r$ ###,###,###.##" &&Problema
endproc
procedure destroy
use in cur1
endproc
enddefine
define class textboxx as textbox
borderstyle = 0
enddefine
define class textboxy as textbox
borderstyle = 0
forecolor = rgb(255,255,255)
selectedforecolor = rgb(255,255,255)
selectedbackcolor = rgb(255,255,255)
enddefine
1 respuesta
Respuesta de davsoft
1