Selection out of range error

6 posts, 0 answers
  1. EmpowerIT
    EmpowerIT avatar
    117 posts
    Member since:
    Jun 2007

    Posted 15 Jan 2008 Link to this post

    I'm getting a Selection Out of Range error when trying to do something very simple with the DropDown control.

    Based on a radio selection list, the items in the drop down list should change. The items are retrieved from a datasource, however i manually add the "All" item to the list. The code is below:

     void JobsList_SelectedIndexChanged(object sender, EventArgs e) 
        { 
            FilterCombo.AppendDataBoundItems = true
            FilterCombo.Items.Clear(); 
            RadComboBoxItem myItem = new RadComboBoxItem("All""-1"); 
            FilterCombo.Items.Insert(0, myItem); 
            FilterCombo.Items[0].Selected = true
            if (JobsList.SelectedValue == "1"
            { 
                FilterCombo.DataSource = TechniciansSource; 
                FilterCombo.DataTextField = "TechName"
                FilterCombo.DataValueField = "TechnicianId"
                FilterCombo.DataBind(); 
            } 
            else 
            { 
                FilterCombo.DataSource = SuburbSource; 
                FilterCombo.DataTextField = "Suburb"
                FilterCombo.DataValueField = "SuburbId"
                FilterCombo.DataBind(); 
            } 
                 
        } 

    Similar code is called when the page first loads (!IsPostBack), and there is no problem. The exception is thrown once it tries to execute the FilterCombo.DataBind() method.

    Any help would be appreciated
  2. EmpowerIT
    EmpowerIT avatar
    117 posts
    Member since:
    Jun 2007

    Posted 15 Jan 2008 Link to this post

    I can confirm that this is a bug/missing feature, as the exact same code works with the RadComboBox for RadControls for ASP.NET Q32007
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Martin
    Martin avatar
    22 posts
    Member since:
    Aug 2007

    Posted 16 Jan 2008 Link to this post

    Have you tried doing the databind and then inserting your "All" item after that?

    Martin
  5. Rosi
    Admin
    Rosi avatar
    2527 posts

    Posted 16 Jan 2008 Link to this post

    Hi ,

    Please try the latest build attached to this message and let us known how it goes.

    Cheers,
    Rosi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. EmpowerIT
    EmpowerIT avatar
    117 posts
    Member since:
    Jun 2007

    Posted 16 Jan 2008 Link to this post

    Hi,
    That hotfix seems to have fixed it, was it a bug?

    Will this fix be available in the next release? Approximately when is the next release?
  7. Nikolay
    Admin
    Nikolay avatar
    3997 posts

    Posted 17 Jan 2008 Link to this post

    Hello EmpowerIT,

    Actually, this fix has been included in the SP1 release launched yesterday. We always include such fixes in the forthcoming versions of the controls.

    Sincerely yours,
    Nick
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017