Position in datagrid at will/Posicionarse en datagrid a voluntad
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Position in datagrid at will/Posicionarse en datagrid a voluntad
I have a datagrid that displays 8 rows with the data of the alphabet. Also I have a button to search where I entered a letter to search. The idea is to display the entered data to search and display it in the following way:
J
K
L
M
N
O
P
Q
After searching you can move with the mause, usually by the datagrid.
Tengo un datagrid que despliega 8 filas con los datos del abecedario. Ademas tengo un button buscar donde ingreso una letra a buscar. La idea es desplegar el dato ingresado a buscar y mostrarlo de la siguiente forma:
J
K
L
M
N
O
P
Q
Después de buscado se pueda de desplazarse con el mause, normalmente por el datagrid.
Jorge Gayoso
Desde el sur del mundo - Chile
J
K
L
M
N
O
P
Q
After searching you can move with the mause, usually by the datagrid.
Tengo un datagrid que despliega 8 filas con los datos del abecedario. Ademas tengo un button buscar donde ingreso una letra a buscar. La idea es desplegar el dato ingresado a buscar y mostrarlo de la siguiente forma:
J
K
L
M
N
O
P
Q
Después de buscado se pueda de desplazarse con el mause, normalmente por el datagrid.
Jorge Gayoso
Desde el sur del mundo - Chile
-
- VIP Livecode Opensource Backer
- Posts: 9785
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Position in datagrid at will/Posicionarse en datagrid a voluntad
Hi.
Not sure exactly what your question is.
But know that you can extract the entire contents of a dataGrid and then do anything you want within LC proper (pseudo):
That sort of thing...
Craig Newman
Not sure exactly what your question is.
But know that you can extract the entire contents of a dataGrid and then do anything you want within LC proper (pseudo):
Code: Select all
put the dgData of group "yourDataGrid" into temp --get the contents into a normal variable
put lineOffset(yourChar,temp) into tLine --find a char
set the dgVScroll of group "yourDataGrid" to the value of tLine based on the textHeight, etc. of the DG
Craig Newman
Re: Position in datagrid at will/Posicionarse en datagrid a voluntad
Dunbarx , thank you very much.
With the instruction:
set the dgVScroll of group "yourDataGrid" to the value of tLine
I was able to solve my problem.
A great greeting from the south of the world.
Jorge Gayoso
With the instruction:
set the dgVScroll of group "yourDataGrid" to the value of tLine
I was able to solve my problem.
A great greeting from the south of the world.
Jorge Gayoso
-
- VIP Livecode Opensource Backer
- Posts: 9785
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Position in datagrid at will/Posicionarse en datagrid a voluntad
Great.
How did you determine the "line height"? Did you divide the formattedHeight by the number of lines?
Craig
How did you determine the "line height"? Did you divide the formattedHeight by the number of lines?
Craig
Re: Position in datagrid at will/Posicionarse en datagrid a voluntad
This was my solution:
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
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
-
- VIP Livecode Opensource Backer
- Posts: 9785
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Position in datagrid at will/Posicionarse en datagrid a voluntad
Aha. dgProp["Row Height"].
Much better than doing the math.
Craig
Much better than doing the math.
Craig