Ran into a problem with the RadComboBox (rcb) today.
Was setting the selected value of the rcb in the page_load function and it was working fine when the rcb looked like this.
<telerik:RadComboBox ID="rcbAssignedTo" DataSourceID="Assignees" AppendDataBoundItems="true"
DataTextField="Name" DataValueField="ID" runat="server" Filter="Contains">
</telerik:RadComboBox>
Page_Load Code: rcbAssignedTo.SelectedValue = Request.QueryString("ato")
However when adding an empty item and AppendDataBoundItems set to true to the list like so
<telerik:RadComboBox ID="rcbAssignedTo" DataSourceID="Assignees" AppendDataBoundItems="true"
DataTextField="Name" DataValueField="ID" runat="server" Filter="Contains">
<Items>
<telerik:RadComboBoxItem Value="" />
</Items>
</telerik:RadComboBox>
The Page_Load code did not work and the rcb was empty. Which is strange because at some point the rcb was populated as it was filled when opening it on the page. However simply databinding the rcb before setting the selectedvalue fixes the problem.
New Page_Load Code: rcbAssignedTo.DataBind()
rcbAssignedTo.SelectedValue = Request.QueryString("ato")
I was just wondering if this is expected behaviour. I have seen several threads talking about LoadOnDemand being set to true will cause the rcb to populate once clicked, however it is set to false in this scenario so I don't see why the rcb would not be populated during page_load.
Was setting the selected value of the rcb in the page_load function and it was working fine when the rcb looked like this.
<telerik:RadComboBox ID="rcbAssignedTo" DataSourceID="Assignees" AppendDataBoundItems="true"
DataTextField="Name" DataValueField="ID" runat="server" Filter="Contains">
</telerik:RadComboBox>
Page_Load Code: rcbAssignedTo.SelectedValue = Request.QueryString("ato")
However when adding an empty item and AppendDataBoundItems set to true to the list like so
<telerik:RadComboBox ID="rcbAssignedTo" DataSourceID="Assignees" AppendDataBoundItems="true"
DataTextField="Name" DataValueField="ID" runat="server" Filter="Contains">
<Items>
<telerik:RadComboBoxItem Value="" />
</Items>
</telerik:RadComboBox>
The Page_Load code did not work and the rcb was empty. Which is strange because at some point the rcb was populated as it was filled when opening it on the page. However simply databinding the rcb before setting the selectedvalue fixes the problem.
New Page_Load Code: rcbAssignedTo.DataBind()
rcbAssignedTo.SelectedValue = Request.QueryString("ato")
I was just wondering if this is expected behaviour. I have seen several threads talking about LoadOnDemand being set to true will cause the rcb to populate once clicked, however it is set to false in this scenario so I don't see why the rcb would not be populated during page_load.