Page 1 of 1

Get field contents on row click for custom sql grid

Posted: Mon Oct 10, 2011 4:59 pm
by Bryan641
I see that I can get the row number in the grid events using the "row" variable, but is there a way to reference the data from one of the columns using this row variable when the grid is a database-driven grid? For example, the file key happens to be the first field in my custom sql, and I'd like to store that value in a hidden field so I can return to my program and know which key was selected, not which row number.

--Bryan

Re: Get field contents on row click for custom sql grid

Posted: Wed Oct 12, 2011 2:10 pm
by Bryan641
I was able to change my sql statement to include an additional column of row# using rank() over(order by ...) and then after grabbing the row# from the double-click I can store that in a hidden field and return to the program for processing, where it uses the row# to get the same record that was in the grid ... unless someone has added or deleted a record between when the grid was populated and the double-click.

A little clumsy, but still less code than the a page-at-a-time subfile logic.

--Bryan