Larry, I must say you can be particularly dismissive when people spend their valuable time to help you.
My code applies equally to a single Data Grid and single button example as it does when you have many Data Grids. Please take the time to implement suggestions before dismissing them so quickly.
OK back your original code.
1. your main issue is that you first need to decide whether you are implementing functionality for a single hilited index (row) or for multiple hilited indices (rows). If you are implementing code for multiple hilited indices (rows) you need some looping structure to process multiple items within the dgHilitedIndexes or dgHilitedLines arrays. If you are interested in a single hilited row only, use dgHilitedIndex or dgHilitedLine.
2. addressing your original code:
your code...
Code: Select all
on mouseUp
put the dgHilitedIndexes of group "DataGrid 1" into theIndex
answer theIndex
put GetDataOfIndex(theIndex, "Ticker") into theColValue -- the heading for column 1 is "Ticker"
answer theColValue
end mouseup
recommended code...
Code: Select all
on mouseUp
put the dgData of group "DataGrid 1" into tData -- obtain the data grid's data
put the dgHilitedIndex of group "DataGrid 1" into tIndex -- obtain the selected (hilited) index
-- but "dgHilitedLine of group "DataGrid 1" into tIndex" works equally well.
put tData[tIndex]["Col 1"] into tInfo -- obtain the data for the selected column "Col 1", for the selected index, for the selected Data Grid and place it in a variable
answer info tinfo -- display the contents of that variable as a dialog
end mouseUp
This code has been tested thousands of times, and works well, as does my first and more detailed solution.
...and as I stressed in my first response, refer to the column name and not the column label in code. In your case check that "Ticker" is indeed the column name and not the column label.
I trust you find my post helpful this time around.
Kind regards, Andrew