I am travelling further into The Wonderful World of Datagrids...
I'd like to set a specific button in a column of a datagrid to invisible, depending on the setting of a different button in the same datagrid. The data grid looks like this:

The Type column contains a menu option button. When the user selects a Type of "Multi-answer", I want to set the button in the Answer column (for that specific row only) to visible. Any other menu option selected in the Type column should set the button in the Answer column (for that row only) to invisible.
My code for the option menu button in the Type column (initially generated by the Data Grid Helper plugin) is:
Code: Select all
on menuPick pTheMenuItem
switch the short name of the target
case "btnType"
SetDataOfIndex the dgIndex of me, the dgColumn of me, pTheMenuItem
answer "The dgIndex of me:" & the dgIndex of me -- My debug line
switch pTheMenuItem
case "Multi-answer"
set the visible of "btnAnswers[dgIndex]" to true
break
default
set the visible of "btnAnswers[dgIndex]" to false
end switch
break
end switch
end menuPick
button "coType Behavior": execution error at line n/a (Chunk: error in object expression) near "btnAnswers[dgIndex]", char 1
I was thinking I could reference the button for that particular row by using dgIndex but this is not right. I am new to datagrids and the related concepts. I've searched the manual and forums for an example like this but can't find one. Any pointers would be helpful.
Thank you muchly
Geoff