Prevent Selectedindexchanged event when DataSource is bound in raddropdownlist?

2 posts, 0 answers
  1. Tra
    Tra avatar
    2 posts
    Member since:
    Feb 2018

    Posted 15 Feb 2018 Link to this post

    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. 
  2. Dimitar
    Admin
    Dimitar avatar
    2907 posts

    Posted 16 Feb 2018 Link to this post

    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.
Back to Top