Event raising question

Discussion in 'ASP .Net Building Controls' started by ~~~ .NET Ed ~~~, Mar 15, 2005.

  1. 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
    ~~~ .NET Ed ~~~, Mar 15, 2005
    #1
    1. Advertising

  2. ~~~ .NET Ed ~~~

    Wilco Bauwer Guest

    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).

    ----
    - Wilco Bauwer
    Blog & Custom Controls @ http://wilcoding.xs4all.nl
    Wilco Bauwer, Mar 16, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dane Dickey

    Raising an Event via Code

    Dane Dickey, Jun 30, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    382
    Natty Gur
    Jul 1, 2003
  2. Kevin Spencer

    Re: raising event

    Kevin Spencer, Jul 31, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    412
    Kevin Spencer
    Jul 31, 2003
  3. Jitu
    Replies:
    0
    Views:
    392
  4. Jeremy Howard
    Replies:
    0
    Views:
    1,239
    Jeremy Howard
    Feb 15, 2004
  5. Jeremy Howard
    Replies:
    0
    Views:
    531
    Jeremy Howard
    Feb 17, 2004
Loading...

Share This Page