Capture Cell Data on DoubleClick
Posted: Tue Jun 28, 2011 6:18 pm
I worked with the Lesson, How Do I Get Data Associated With a Row or Column?
This works well, but in order to get the data from a specific column, you need to know the name of the column. For example, this code, from the above lesson gets the line number from dgHilitedLines and then the dgDataOfLine, to put the line into an array. Finally WITH the column name, you can grab the contents of that cell.
I'd like to set my DataGrid to NOT "allow editing" -- then on the mouseDoubleDown message (event) -- retrieve the cell data.
How do I discern the column where the mouseDoubleDown Message (event) occurs?
Does this require editing the DataGrid Template code? Or is there an easier way?
This works well, but in order to get the data from a specific column, you need to know the name of the column. For example, this code, from the above lesson gets the line number from dgHilitedLines and then the dgDataOfLine, to put the line into an array. Finally WITH the column name, you can grab the contents of that cell.
Code: Select all
put the dgHilitedLines of group "myGrid" into line.number
put the dgDataOfLine[line.number] of group "myGrid" into line.array
put line.array["colName"] into cellContents
How do I discern the column where the mouseDoubleDown Message (event) occurs?
Does this require editing the DataGrid Template code? Or is there an easier way?