Event raising question

N

~~~ .NET Ed ~~~

Hi,
I have a question regarding events in a composite web control. In
windows forms when I programmatically set the SelectedIndex property of a
comboBox (for example) I seem to remember that the SelectedIndexChanged
event is automatically fired (unless my mind is playing tricks on me). Well,
in my custom web control I set the SelectedIndex property of the sub-control
but I don't see the event being fired. It only gets fired when the user
actually selects it on the web form but not when I do it programmatically.

Now, is there anything I can do beside actually programmatically calling
them? My idea was that I would set the SelectedIndex on the first (top
level) and that it automatically would fire the selectedIndexChanged so that
it then propagates to the other, etc. but that is not happening.

Ideas?

Thx,
Emil
 
W

Wilco Bauwer

You could try to inherit from the DropDownList (I assume that's what
you're talking about), override SelectedIndex and call
OnSelectedIndeChanged in your setter (in case the index is actually
changed).
 

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

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top