SelectedIndexChanged

J

Jon Cosby

How does the "SelectedIndexChanged" event work on a dropdown list? I have

private void InitializeComponent()
{
this.ListClients.SelectedIndexChanged += new
System.EventHandler(this.ListClients_SelectedIndexChanged);
}

private void ListClients_SelectedIndexChanged(object sender,
System.EventArgs e)
{
// Do something

}

but it never gets to the event handler when I select an item on the list.
Does "SelectedIndex" have some dubious meaning I'm not aware of?


Jon Cosby
 
G

Guest

Hi

Why are you adding an event handler to the event SelectedIndexChanged when it already exists natively

Michael H

----- Jon Cosby wrote: ----

How does the "SelectedIndexChanged" event work on a dropdown list? I hav

private void InitializeComponent(

this.ListClients.SelectedIndexChanged += ne
System.EventHandler(this.ListClients_SelectedIndexChanged)


private void ListClients_SelectedIndexChanged(object sender
System.EventArgs e

// Do somethin



but it never gets to the event handler when I select an item on the list
Does "SelectedIndex" have some dubious meaning I'm not aware of


Jon Cosb
 
J

Jon Cosby

Michael H. said:
Hi,

Why are you adding an event handler to the event SelectedIndexChanged when it already exists natively?
I'm just using the auto-generated code to specify the event procedure.


Jon
 

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

Top