DataList selection

  • Thread starter Michael Groeger
  • Start date
M

Michael Groeger

Hi,

I have a DataList which is filled with a custom control. The custom control
contains a image and a label. The problem is that neither the
SelectedIndexChanged event of the DataList is fired nor the SelectedItem
template is shown (same custom control with different back color and fore
color) when clicking on a control inside the DataList. What am I doing wrong
here?

Regards,
Michael
 
S

Scott Allen

Hi Michael:

The SelectedIndexChanged event fires when the user selects a specific
control in the list - not just any control. The general approach is
for people to add a Button or an ImageButton to each row (think of it
as the "Select" button, and wire the Select button to the
SelectedIndexChanged event.
 
M

Michael Groeger

Hi Scott,

so for my understanding, is it correct, that SelectedIndexChanged wires to
the Button.Click event, it might help, if my custom control simply exposes a
click event itself, which gets triggered, whenever a control inside is
clicked?

Regards,
Michael
 

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,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top