Page 1 of 1

How do I get the index of a datagrid row?

Posted: Sat May 24, 2014 9:42 pm
by charms
Hi there,

I need to get the index of the current pData entry in the behaviour script. I have a button in the row template that requires the index for further processing.

Does anybody know how I can get it? I tried with dgIndex of me but somehow this doesn't work.

Code: Select all

on FillInData pData
    -- This message is sent when the Data Grid needs to populate
    -- this template with the column data. pData is the value to be displayed.
    
    -- Example:
   --set the text of field 1 of me to pData
   set the icon of button "iconBtn" of me to ("fs_" & pData & ".png")
   set the uIndex of button "iconBtn" to the dgIndex of me -- This is what I try to achieve but the index is empty!
end FillInData

Re: How do I get the index of a datagrid row?

Posted: Sat May 24, 2014 9:50 pm
by bangkok
What about :

Code: Select all

put GetDataOfIndex(the dgIndex of me, the dgColumn of me) into theColumnValue
?

Re: How do I get the index of a datagrid row?

Posted: Sat May 24, 2014 10:10 pm
by charms
Thanks Bangkok, this solved my problem.

Code: Select all

on FillInData pData
    -- This message is sent when the Data Grid needs to populate
    -- this template with the column data. pData is the value to be displayed.
    
    -- Example:
   --set the text of field 1 of me to pData
   set the icon of button "iconBtn" of me to ("fs_" & pData & ".png")
   set the uIndex of button "iconBtn" of me to the dgIndex of me
end FillInData