Selected row's RowTag?

Hi,
I am trying to bind the RowTag of the selected listbox row, but I’m struggling with how to modify the code below to include the Rowtag :frowning:

ps.Bind(0,  Window1.Listbox2.cell(Window1.Listbox2.listindex))

Can anyone help?
Thank you all in advance.

Break it down into smaller bits first. Plus it looks like you’re not doing RowTag right. You have to tell it WHICH row tag to get using the ListIndex.

if Window1.Listbox2.Listindex = -1 then return //no selection! dim iData as integer iData = Window1.Listbox2.RowTag(Window1.Listbox2.ListIndex) ps.bind(0, iData)

Ahh - that makes sense.
I seemed to be approaching it in reverse.

It becomes blindingly obvious when you actually see working code :slight_smile:

Thanks for that Bob - much appreciated!

Don’t know if it would help, but I’ve got over 50 hours of Real Studio and Xojo training video at http://xojo.bkeeney.com/XojoTraining/. Most of them come with project files containing source that you can use in your own projects. There are two complete start to finish desktop app projects and one start to finish web app project.

Thanks - I will take a look.