Getting row data from listbox event in repeater.

  • Thread starter Thread starter Sosh
  • Start date Start date
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!
 
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
 
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?
 
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

Similar Threads


Back
Top