<radC:RadComboBox ID="ddlCustomers" runat="server" Height="300px" EnableLoadOnDemand="true"
HighlightTemplatedItems="true" Skin="WindowsXP" Width="300px" AutoPostBack="true" />
I load the combobox in the ItemRequested event as follows:
With ddlCustomers
'-- 1) Clear any items that already exist --
.Items.Clear()
'-- 2) Set the fields, get the dataset and bind the results --
.DataTextField = strTextField
.DataValueField = strValueField
.DataSource = GetDataTable(chkActiveOnly.checked)
.DataBind()
End With
I have a checkbox on the page that is autopostback and ajaxifies as follows:
<asp:CheckBox ID="chkActiveOnly" runat="server" Text="Active Customers Only" AutoPostBack="true" />
<radA:RadAjaxManager ID="ramManageCustomers" runat="server">
<AjaxSettings>
<radA:AjaxSetting AjaxControlID="chkActiveOnly">
<UpdatedControls>
<radA:AjaxUpdatedControl ControlID="chkActiveOnly" />
<radA:AjaxUpdatedControl ControlID="ddlCustomers" />
</UpdatedControls>
</radA:AjaxSetting>
</AjaxSettings>
</radA:RadAjaxManager>
Here is the checkchanged event for my checkbox:
Protected
Sub chkActiveOnly_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles chkActiveOnly.CheckedChanged
Response.Cookies.Add(
New HttpCookie("ShowInactive", Not chkActiveOnly.Checked))
ddlCustomers.Items.Clear()
End Sub
When I navigate to the page, the stored procedure in the ItemRequested event pulls only records that are marked active in the DB. If I click the checkbox to uncheck it (meaning I want to populate the combobox with all values and not just those that are marked active in the DB), the combobox fills all values just fine. However, if I try to filter the combobox by entering a "t" in the textbox area of the combobox so that it only shows records in the combobox that start with a "t", the list reverts back to the original stored procedure used (which filters out inactive records). I am assuming this is a problem with how the radcombobox ajaxifies, but if you have a work around, that would really help.