grid como Excel
Posted: Sun Apr 30, 2017 10:00 pm
Hola a todos.
Modifiqué un poco el código del demo39 porque necesitaba salir de la edición del grid con un simple ENTER. Habrá una forma mas simple de hacerlo?
y mi otra duda: si en mi aplicación original hice el grid con el IDE cómo adecuar el On Key? , tambien el On Click en el script, por ejemplo:
Frm_sumativa.grid_2.On Click onclick() <---esto no me funciona
Hi all
I modified the demo39 code because I needed to exit the grid edit with a simple ENTER. Will there be a simpler way to do it?
And my other question: if in my original application I did the grid with the IDE how to adapt the On Key? , Also the On Click in the script, for example:
Frm_sumativa.grid_2.On Click onclick () <---this does not work
Gracias.
Atentamente: Antonio
Modifiqué un poco el código del demo39 porque necesitaba salir de la edición del grid con un simple ENTER. Habrá una forma mas simple de hacerlo?
y mi otra duda: si en mi aplicación original hice el grid con el IDE cómo adecuar el On Key? , tambien el On Click en el script, por ejemplo:
Frm_sumativa.grid_2.On Click onclick() <---esto no me funciona
Hi all
I modified the demo39 code because I needed to exit the grid edit with a simple ENTER. Will there be a simpler way to do it?
And my other question: if in my original application I did the grid with the IDE how to adapt the On Key? , Also the On Click in the script, for example:
Frm_sumativa.grid_2.On Click onclick () <---this does not work
Code: Select all
/*
* HMG Data-Bound Grid Demo
* (c) 2010 Roberto Lopez
*/
#include <hmg.ch>
Function Main
SET CELLNAVIGATIONMODE EXCEL
define window sample at 0, 0 width 320 height 200 title 'Sample Cell Navigation Downwards...' main
define grid grid_1
row 10
col 10
width 300
height 150
widths { 100, 170 }
headers { 'Criterios', 'Puntos'}
ON KEY onkey() //como ponerlo si usé el IDE para crear el grid
cellnavigation .t.
on click navega() //como ponerlo si usé el IDE para crear el grid
on dblclick navega()
columnwhen { {|| This.Cellvalue>='A'}, {|| This.Cellvalue>=0}}
columncontrols { { 'TEXTBOX', 'CHARACTER' },{ 'TEXTBOX', 'NUMERIC', '999' } }
allowedit .t.
items { { 'Cuaderno', 0 }, { 'Participacion', 0 }, { 'Tarea', 0 }, { 'Examen', 0 } }
end grid
end window
sample.center
sample.activate
Return
function onkey()
if this.cellrowindex==4
if HMG_GetLastVirtualKeyDown()==13
sample.grid_1.cellnavigation := .f.
endif
endif
return
function navega()
sample.grid_1.cellnavigation:= .t.
return
Atentamente: Antonio