I went to that Lesson you suggested, on overriding behavior for column cells.
Wow-- I must say-- I've been actively working with LiveCode for about three months,
and I'm continually impressed with how well everything fits together.
This is the first time I've thought, this doesn't seem right.
That is-- to control DataGrid column behavior, it looks like you need to create a Button then link the Button to the DataGrid. That does seem odd. It would make much more sense to just have all these extra Handlers in the DataGrid code itself.
Before going this route, I thought I'd try something else, which almost seems to work. This code is placed directly in the DataGrid. It prevents a double click edit on the cell AND presents an ASK window instead.
Code: Select all
on editcellofindex tName tRow
put the dgDataOfLine[tRow] of group mygrid into theDataA
ask "Enter New Value:" with theDataA[tName] titled theDataA[tName]
if the result is "Cancel" then
else
SetDataOfIndex the tRow of me, theDataA[tName], it
refreshIndex the tRow of me
end if
end editcellofindex
The Ask box sometimes gets mixed up and returns the wrong row.
The SetDataOfIndex command never works. Is this a totally far fetched
use of the EditCellOfIndex Message event? Or could this be a viable solution?