Page 1 of 1

DataGrid:Control in Row Template:Messages

Posted: Tue Jun 02, 2009 6:49 pm
by jsims
Hi,

I've been playing around with some DataGrid stuff and have come across something that I'm not sure if it is a bug or expected behavior.

I have a Row Template that contains a Button (checkbox type) and a couple of other fields. I edited the group in the Row Template and tried to edit the script of the Button (I'm trying to think through implementing some Behaviors to use as the Parent Script).

It did not appear that this code was being called (would not activate the breakpoint in the debugger). So I tried a simple script for the button in the Row Template:

Code: Select all

on mouseUp
  answer "here"
end mouseUp
When I populate my DataGrid with data (using dgData) and click on the checkbox, it doesn't say "here".

I found that I could work with the messages in the Row Behavior. I'm just really trying to wrap my head around the nuances of the DataGrid (which, btw, I think is just wonderful!!!) and trying to determine where/how to implement behaviors for the controls I put into the Row Template.

Thanks in advance for any help/advice anyone has to offer!

Posted: Wed Jun 03, 2009 2:50 pm
by trevordevore
All controls in a row template will receive their normal engine messages so a mouseUp script in a checkbox should work, assuming nothing else is getting in the way. Is there any change there is a nother control in front of the checkbox? When you click on the checkbox does the hilite state of it change?

Posted: Thu Jun 04, 2009 2:05 am
by jsims
Hi Trevor,

First off, I have to apologize. It was a Button of type Option that was giving me the problem with the mouseup. I played with it some more and, after adding a plain button to do some other testing, I realized that I wasn't clicking the Refresh Datagrid button which seems to have completely solved the problem.

Thanks for your time! Sorry if I caused you any worry. I know how little things like this can just eat at you until you have an answer.

Posted: Thu Jun 04, 2009 3:36 pm
by trevordevore
No worries. Glad you got everything working.