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

RadComboBox Auto Complete Problem

1 Answer 384 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Syed
Top achievements
Rank 1
Syed asked on 22 Dec 2011, 02:03 PM
I want to bind states combo box based on which country is selected but when i try to do that programmatically i get the following error
"There is no assigned data source. Unable to complete callback request."

Here is my code
<telerik:RadComboBox ID="ddlState" runat="server" AllowCustomText="true" MaxHeight="100px" EnableAutomaticLoadOnDemand="true"></telerik:RadComboBox>
    public void fillState(long countryId)
    {
        g_frontendDataContext fdc = new g_frontendDataContext();
        try
        {
            var states = from i in fdc.tbl_sfl_states
                         where i.fk_country_id == countryId
                         select new
                         {
                             stateId = i.pk_state_id,
                             stateName = i.state_name
                         };
            ddlState.DataSource = states.ToList();          
            ddlState.DataBind();           
            ddlState.DataTextField = "stateName";
            ddlState.DataValueField = "stateId";          
            fdc.Dispose();
        }
}

1 Answer, 1 is accepted

Sort by
0
Ivana
Telerik team
answered on 23 Dec 2011, 05:10 PM
Hi Syed,

Make sure the RadComboBox control gets populated successfully.  For more information about different load on demand modes, you could refer to the following online demo: RadComboBox / Load on Demand modes.

You could also refer to the Related RadComboBoxes demo, to see how a related RadComboBoxes scenario is achieved.

I hope this helps.

All the best,
Ivana
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
Tags
ComboBox
Asked by
Syed
Top achievements
Rank 1
Answers by
Ivana
Telerik team
Share this question
or