This is a migrated thread and some comments may be shown as answers.
Prevent Selectedindexchanged event when DataSource is bound in raddropdownlist?
1 Answer 24 Views
This is a migrated thread and some comments may be shown as answers.
Tra
Top achievements
Rank 1
Tra asked on 15 Feb 2018, 12:50 PM
Hi this is my first time posting here in telerik. I have a drop down list and planning to do disable selectedindexchange event before I bound it's datasource. I tried this  code:  this.comboBox1.SelectedIndexChanged -= new EventHandler(comboBox1_SelectedIndexChanged); but it gives me "No overload for 'comboBox1_SelectedIndexChanged matches delegate system.eventhandler. 

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 16 Feb 2018, 11:02 AM
Hello Tra,

It appears the event handler cannot be found or has invalid arguments. The following snippet shows how you can unsubscribe along with the event handler:
public RadForm1()
{
    InitializeComponent();
 
    radDropDownList1.SelectedIndexChanged += RadDropDownList1_SelectedIndexChanged;
    radDropDownList1.SelectedIndexChanged -= RadDropDownList1_SelectedIndexChanged;
}
 
private void RadDropDownList1_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
{
    

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Asked by
Tra
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or