The sistuation:
when i loading the data source of comboBox as following code, it will trigger the SelectedIndexChanged event, even I add the handler after assign the datasource.....
ds = data.GetDataSet()
dt = ds.Tables(0)
If dt.Rows.Count > 0 Then
'Me.comboBox.DataSource = dt
'Me.comboBox.DisplayMember = "name"
Me.comboBox.ValueMember = "id"
Me.comboBox.SelectedIndex = -1
End If
AddHandler comboBox.SelectedIndexChanged, _
AddressOfcomboBox_SelectedIndexChanged
How can i avoid the event when the control is binding the datasource?
Thanks,