Page 1 of 1

Getting selected text of a Data Grid

Posted: Tue Jun 26, 2012 8:49 pm
by Jayare
Hello everybody,

i have created a simple Data Grid with two Colums. There are several lines of text in the Data Grid. My user should select one of the shown Rows. I want to get the data of a selected row in a variable.

I have done this in a scrolling field with this code (here it is simple!):
"put the selectedtext of field "artikelportal" into gAnzeige_artikel"

It would be great, if anybody could tell me, how i can do this action in a Data Grid!!!!

thanks
Jochen

Re: Getting selected text of a Data Grid

Posted: Tue Jun 26, 2012 9:20 pm
by townsend
I think you'll find the answer you're looking for here:
Create, Read, Update, Delete Example

Re: Getting selected text of a Data Grid

Posted: Tue Jun 26, 2012 9:33 pm
by sturgis
Jochen, check out the lesson here for the datagrid: http://lessons.runrev.com/s/lessons/m/d ... -or-column

I think this will get you pointed the right direction.
Jayare wrote:Hello everybody,

i have created a simple Data Grid with two Colums. There are several lines of text in the Data Grid. My user should select one of the shown Rows. I want to get the data of a selected row in a variable.

I have done this in a scrolling field with this code (here it is simple!):
"put the selectedtext of field "artikelportal" into gAnzeige_artikel"

It would be great, if anybody could tell me, how i can do this action in a Data Grid!!!!

thanks
Jochen

Re: Getting selected text of a Data Grid

Posted: Tue Jun 26, 2012 10:04 pm
by townsend
I found this in the doUpdate handler. I think that's what you're looking for.

Code: Select all

     put the dgHilitedLines of group "mygrid" into theLine  --grabs hilited line
     put the dgDataOfLine[theLine] of group "mygrid" into theDataA
     -- theDataA is now an array variable.
     -- then you get the specific column values by using the column names
     put theDataA["Handle"] into myHandle 
     put theDataA["Entry"] into myEntry 

Re: Getting selected text of a Data Grid

Posted: Sun Jul 01, 2012 10:27 am
by Jayare
WOW, you guys Rock!!!!

Now everything works perfect.

Thanks
Jochen