Page 1 of 1

Selection and focus of line in datagrid/Seleccion y foco de linea en datagrid

Posted: Wed Feb 28, 2018 4:06 pm
by jgayoso
Ingles:
I want to change the selected line and focus of a datagrid, without using the mouse, for example by means of a button:
If I press button A, row A is displayed as active and with focus in the datagrid.
If I press button E, row E is displayed as active and with focus in the datagrid.
If I press button G, row G is displayed as active and with focus in the datagrid.

EspaƱol:
Deseo cambiar la linea seleccionada y foco de un datagrid, sin usar el mouse, por ejemplo por medio de button:
Si presiono button A se despliega en el datagrid la fila A como activa y con el foco.
Si presiono button E se despliega en el datagrid la fila E como activa y con el foco.
Si presiono button G se despliega en el datagrid la fila G como activa y con el foco.

Example/Ejemplo:
BUTTON A
----
A
----
B
C
D
E
F
G

BUTTON E
A
B
C
D
----
E
----
F
G



BUTTON G
A
B
C
D
E
F
----
G
----

Re: Selection and focus of line in datagrid/Seleccion y foco de linea en datagrid

Posted: Wed Feb 28, 2018 5:41 pm
by jgayoso
I already solve it with:

set the dgHilitedIndex of group "DataGrid_1" to tNLinea_DataGrid


Function fPosiciona_DataGrid tTexto, tNAntes
dispatch "FindIndex" to group "DataGrid_1" with "carta_descripcion", tTexto
put the result into tNLinea_DataGrid

put (the dgProp["Row Height"] of group "DataGrid_1") * (tNLinea_DataGrid - tNAntes) into tLine

set the dgVScroll of group "DataGrid_1" to the value of tLine

set the dgHilitedIndex of group "DataGrid_1" to tNLinea_DataGrid

end fPosiciona_DataGrid

Greetings from the south of the world

Jorge Gayoso