I have the following problem with a Telerik RadDropDownList:
Markup:
<asp:UpdatePanel ID=
"updatepanelInput"
runat=
"server"
UpdateMode=
"Conditional"
>
<ContentTemplate>
<asp:TextBox ID=
"txtInput"
runat=
"server"
ClientIDMode=
"Static"
/>
<asp:Button ID=
"btnSearch"
OnClick=
"btnDoSearch_Click"
runat=
"server"
ClientIDMode=
"Static"
/>
<telerik:RadDropDownList ID=
"ddlResults"
runat=
"server"
ClientIDMode=
"Static"
DropDownWidth=
"70%"
AutoPostBack=
"true"
OnSelectedIndexChanged=
"ddlResults_SelectedIndexChanged"
/>
<telerik:RadDropDownList ID=
"ddlHistoryDates"
runat=
"server"
ClientIDMode=
"Static"
AutoPostBack=
"true"
OnSelectedIndexChanged=
"ddlHistoryDates_SelectedIndexChanged"
/>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID=
"ddlResults"
EventName=
"DataBound"
/>
</Triggers>
</asp:UpdatePanel>
Code behind:
protected
void
btnDoSearch_Click(
object
sender, EventArgs e)
{
AsynchronousQueryExecutor.Call(dataservice.getQuickSearch(currentLan, txtInput.Text, (
int
)SearchOptions.IncludeInactive), QuickSearchLoaded, LoadFailed);
//on query success 'QuickSearchLoaded' will be executed
}
public
void
QuickSearchLoaded(List<spData4_QuickSearch_NomenBaseResult> result)
{
ddlResults.DataSource = result;
ddlResults.DataValueField =
"id"
;
ddlResults.DataTextField =
"description"
;
ddlResults.DataBind();
AsynchronousQueryExecutor.Call(dataservice.getHistoryDates(result.FirstOrDefault().id), HistoryDatesLoaded, LoadFailed);
//on query success 'HistoryDatesLoaded' is executed
}
public
void
HistoryDatesLoaded(List<spData4_Historiek_GetHistoriek_BedragenResult> result)
{
ddlHistoryDates.DataSource = result;
ddlHistoryDates.DataValueField =
"DateHistory"
;
ddlHistoryDates.DataTextField =
"Item"
;
ddlHistoryDates.DataBind();
}
So basically when btnSearch is clicked a query result should fill ddlResults and based on this result a new query is executed and returning a result which should be filled in ddlHistoryDates. Both query are executed successfully, but only ddlResults is showing data. ddlHistoryDates stays empty.
Calling updatePanelInput.Update() after ddlHistoryDates.DataBind() is giving me the following error:
the update method can only be called on updatepanel with id before render
Anyone who knows what i'm doing wrong?