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
"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();
}
}