Ajax Combobox Selection

2 posts, 0 answers
  1. Joseph Baker
    Joseph Baker avatar
    17 posts
    Member since:
    Jul 2006

    Posted 15 May 2008 Link to this post

    I have 2 combo boxes on my page.  when I change the first one, it loads the 2nd combo data (using a template).  However, the SELECTED item displayed in the combo box does not change.

    telerik:RadComboBox ID="cmbCarrier" runat="server" DataSourceID="sqlCarrier" 
            DataTextField="Name" DataValueField="CARRIER_ID" AutoPostBack="True" Width="388px" CausesValidation="False">  
            <CollapseAnimation Duration="200" Type="OutQuint" /> 
        </telerik:RadComboBox> 
        Select Contract:  
        <telerik:RadComboBox  ID="cmbContract" runat="server" DataSourceID="sqlContracts" MarkFirstMatch="true" OnDataBound="cmbContract_DataBound" EnableLoadOnDemand="true" HighlightTemplatedItems="true"   Width="420px"  OnItemDataBound="cmbContract_ItemDataBound" OnSelectedIndexChanged="cmbContract_SelectedIndexChanged" CausesValidation="False" > 
                                    <HeaderTemplate> 
                                <table style="width: 100%; text-align: left">  
                                    <tr> 
                                        <td style="width: 125px;">  
                                            Contract ID  
                                        </td> 
                                        <td style="width: 125px;">  
                                            Carrier  
                                        </td> 
                                        <td style="width: 125px;">  
                                            Description  
                                        </td> 
                                    </tr> 
                                </table> 
                            </HeaderTemplate> 
                            <ItemTemplate> 
                                <table style="width: 100%; text-align: left">  
                                    <tr> 
                                         <td style="width: 125px;">  
                                            <%# DataBinder.Eval(Container.DataItem, "CONTRACT_ID") %> 
                                        </td> 
                                        <td style="width: 125px;">  
                                            <%# DataBinder.Eval(Container.DataItem, "Name") %> 
                                        </td> 
                                        <td style="width: 125px;">  
                                            <%# DataBinder.Eval(Container.DataItem, "DESCRIPTION") %> 
                                        </td> 
                                     
                                    </tr> 
                                </table> 
                            </ItemTemplate> 
            <CollapseAnimation Duration="200" Type="OutQuint" /> 
        </telerik:RadComboBox> 
        protected void cmbContract_ItemDataBound(object sender, Telerik.Web.UI.RadComboBoxItemEventArgs e)  
        {  
            {  
                e.Item.Text = ((DataRowView)e.Item.DataItem)["CONTRACT_ID"].ToString() + "; " + ((DataRowView)e.Item.DataItem)["Name"].ToString() + "; " + ((DataRowView)e.Item.DataItem)["DESCRIPTION"].ToString();  
                e.Item.Value = ((DataRowView)e.Item.DataItem)["CONTRACT_ID"].ToString() + "; " + ((DataRowView)e.Item.DataItem)["Name"].ToString() + "; " + ((DataRowView)e.Item.DataItem)["DESCRIPTION"].ToString();  
            }  
     
        } 

    I simply want the first item in the list to be displayed.
  2. Rosi
    Admin
    Rosi avatar
    2527 posts

    Posted 16 May 2008 Link to this post

    Hi Joseph Baker,

    To provide you with a solution we need some more information . Could you please paste here the code you use to populate the second combobox based on first combo or ideally open a support ticket and send us a simple and running project illustrating the problem? Also, could you send some more information about the ajax settings - the definition of RadAjaxPanel or RadAjaxManger you use.

    Regards,
    Rosi
    the Telerik team

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