RadComboBox - SelectedIndexChanged not firing

2 posts, 0 answers
  1. Paul
    Paul avatar
    10 posts
    Member since:
    Jun 2011

    Posted 05 Mar 2013 Link to this post

    I see many other posts about this problem, but none seem to be the same problem i am having.

    The scenario is simple....i have a single .ASPX page which contains a single RadComboBox and 3 or 4 usercontrols, all of which contain a single RadGrid.  Based on the selection made in the RadComboBox i want to change the datasource for each of the RadGrids in the usercontrols, and rebind them.

    When the page is initially opened, the ComboBox is empty. When i select an item it fires the event as expected and everything seems to be fine, datasources are correctly modified, and RadGrids rebind. 

    However, when i then change the selection by selecting a different item in the RadCombobox, the OnSelectedIndexChanged event does not fire....and i am confused as to why.  It also seems as though I have to click twice on an item to get it to make the selection....no idea why this would be the case either.

    Here are the relevant bits of code:

    .ASPX Page
    <asp:ObjectDataSource ID="dsTerm" runat="server" SelectMethod="FetchList" TypeName="BenemTech.SHSR_DonorMgmt.DTO.TermDTO" />
     
    <telerik:RadComboBox ID="cboGraduatingTerm" runat="server"
                        DataSourceID="dsTerm" DataTextField="Description"
                        DataValueField="TermID" EmptyMessage="Please Select"
                        onselectedindexchanged="cboGraduatingTerm_SelectedIndexChanged" AutoPostBack="true" AppendDataBoundItems="true">
                        <Items>
                        <telerik:RadComboBoxItem Text="Please Select" Value="-1" />
                        </Items>
                    </telerik:RadComboBox>

    Code Behind:
    protected void Page_Load(object sender, EventArgs e)
            {
            }
     
    protected void cboGraduatingTerm_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
            {
                int termID = System.Convert.ToInt32(this.cboGraduatingTerm.SelectedValue);
     
                if (termID > 0)
                {
                    pnlRecipients.Visible = true;
     
                    // Need to set the value of the GraduatingTermID of the recipients control. By doing so it should also be rebound.
                    this.usrSelectPSRecip.GraduatingTermID = termID;
                    this.usrSelectMSRecip.GraduatingTermID = termID;
                    this.usrSelectHSRecip.GraduatingTermID = termID;
                    this.usrSelectUnivRecip.GraduatingTermID = termID;
                }
                else
                {
                    pnlRecipients.Visible = false;
                }
           }

    the user controls "usrSelectPSRecip" etc are just a simple usercontrols that each have a single Radgrid in it as well as a few additional properties.

    The important thing is that the first time i select an item from the RadCombobox, it works great.......but anytime after that it doesn't fire the event.

    Any suggestions as to why?

    Thanks in advance.

    Paul H.
  2. Nencho
    Admin
    Nencho avatar
    1871 posts

    Posted 08 Mar 2013 Link to this post

    Hello Paul,

    The implementation and the usage of the RadComboBox seems to be correct. Could you make sure, that there are not any JavaScript exceptions on your page?


    Kind regards,
    Nencho
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top