Getting row data from listbox event in repeater.

S

Sosh

Hi,

I'm sure there must be any easy way of doing this, but I just can't
see it:

I have a repeater bound to a dataset. In each item of the repeater I
have a listbox with a few options. I want to be able to access the
repeater's row data from inside the method wired up to the listbox's
OnItemIndexChanged event. Is this possible?

Thanks!
 
E

Eliyahu Goldin

Yes. You need to navigate in ItemTemplate. The event handler gets a
reference on the object that generated the event. You need to understand the
object hierarchy and operate with properties Parent and Controls.
FindControl() method is also useful.

Eliyahu
 
S

Sosh

Thanks Eliyahu. Could you give me an example of how I access the
parent repeater row using the listbox sender object in the wired up
method?
 
S

Sosh

Alternatively, is there any way of getting the listbox
OnItemIndexChanged event to cause the Repeater OnItemCommand event to
fire, so that I then have access to the RepeaterCommandEventArgs?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top