why is this SelectedIndexChanged event handler called when I set theDataSource

T

tony

Hello!
I have ComboBox control called comboBoxSchedule and when I execute
comboBoxSchedule.DataSource = ds.Tables[0];
the event handler below is called.
private void comboBoxSchedule_SelectedIndexChanged(object sender,
EventArgs e)

Can somebody explain why this event handler is called.

//Tony
 
T

Tom P.

Hello!
I have ComboBox control called comboBoxSchedule and when I execute
comboBoxSchedule.DataSource    = ds.Tables[0];
the event handler below is called.
private void comboBoxSchedule_SelectedIndexChanged(object sender,
EventArgs e)

Can somebody explain why this event handler is called.

//Tony

Because the "SelectedIndex" is changed to the first item in the table.

Tom P.
 
Y

youquijano

how can i trigger my OnSelectedIndexChanged programatically?

i mean do it code behind...

i already added the event on my aspx and in my page_load i have a
function that populates my datagrid and automatically select the index
0
 

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