Page 1 of 1

Datagrid Options Menu Label

Posted: Thu Jan 26, 2017 4:39 am
by newpie
Hello, I wanted to check with forum on this. Isthe label of an Options Menu button supposed stay when you load the Options menu in a datagrid table. When I try using "set the label of btn.." it doesn't stick. I would like to have the label "Select:" and then my menu items underneath.

The only method I found that worked is below, but then Select is one of menu items.

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:
   lock messages
   set the text of btn "methodType" of me to "Select:"& cr & "Method A"& cr & "Method B"
   set the menuhistory of button "methodType" of me to lineoffset(pData, the text of button "methodType" of me)
   unlock messages
end FillInData
Thanks for any help

Re: Datagrid Options Menu Label

Posted: Thu Jan 26, 2017 2:52 pm
by Klaus
I really did not know that we could place any other objects than fields into a datagrid of type TABLE!? :shock:

Anyway, it should be enough to:

Code: Select all

on FillInData pData
   set the label of btn "methodType" of me to pData
end FillInData

Re: Datagrid Options Menu Label

Posted: Fri Jan 27, 2017 1:31 am
by newpie
Thank you Klaus, that seem to do the trick when I changed the pData above to "Select:"