This is a migrated thread and some comments may be shown as answers.

Ajax Combobox Selection

1 Answer 80 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Joseph Baker
Top achievements
Rank 2
Joseph Baker asked on 15 May 2008, 06:52 PM
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.

1 Answer, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 16 May 2008, 01:12 PM
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
Tags
ComboBox
Asked by
Joseph Baker
Top achievements
Rank 2
Answers by
Rosi
Telerik team
Share this question
or