From Telerik support:
The
behavior you're experiencing is expected due to how the RadComboBox
ItemsRequested event works. The ItemsRequested event is triggered by an
internal AJAX callback used exclusively for loading items on demand into the
RadComboBox. This callback updates only the ComboBox items; it does not
update or refresh other controls on the page, even if they are inside a
RadAjaxPanel or RadAjaxManager. Changes to controls like lnkNewCustomer or
txtTime inside the ItemsRequested handler will not reflect on the client,
because the partial update is limited to the ComboBox itself.
Why This Happens
The ItemsRequested event
uses a dedicated internal AJAX callback mechanism designed
exclusively for loading items on demand. This callback:
- Updates only the ComboBox items
- Does not refresh other controls on
the page
- Ignores changes made to controls like
lnkNewCustomer or txtTime
- Cannot be intercepted by
RadAjaxPanel or RadAjaxManager
This is by design to keep the load-on-demand operation
lightweight and efficient.
Solution Options
Use the client-side OnClientItemsRequested event
to update controls via JavaScript after items load:
<telerik:RadComboBox ID="cboCustomer" runat="server"
Width="500px"
RenderMode="Lightweight"
AllowCustomText="true"
AutoPostBack="true"
DataTextField="custname"
DataValueField="custnmbr"
EnableAutomaticLoadOnDemand="true"
ItemsPerRequest="25"
OnClientItemsRequested="onItemsRequested">
</telerik:RadComboBox>
<script type="text/javascript">
function onItemsRequested(sender, eventArgs) {
var lnkNewCustomer = document.getElementById("<%= lnkNewCustomer.ClientID %>");
if (lnkNewCustomer) {
lnkNewCustomer.style.color = "black";
lnkNewCustomer.style.pointerEvents = "auto";
}
var txtTime = $find("<%= txtTime.ClientID %>");
if (txtTime) {
txtTime.set_value(new Date().toLocaleString());
}
}
</script>
Option 2: Trigger a
Separate AJAX Postback
Use the client-side event to trigger a hidden button that initiates a proper
AJAX postback:
<asp:Button runat="server" ID="btnHiddenUpdate" style="display:none" />
<telerik:RadComboBox ID="cboCustomer" runat="server"
EnableAutomaticLoadOnDemand="true"
OnClientItemsRequested="triggerServerUpdate">
</telerik:RadComboBox>
<script type="text/javascript">
function triggerServerUpdate(sender, eventArgs) {
__doPostBack('<%= btnHiddenUpdate.UniqueID %>', '');
}
</script>
Server-side handler (VB.NET):
Private Sub btnHiddenUpdate_Click(sender As Object, e As EventArgs) Handles btnHiddenUpdate.Click
lnkNewCustomer.Enabled = True
lnkNewCustomer.ForeColor = System.Drawing.Color.Black
txtTime.Text = String.Format("{0:MM/dd/yyyy hh:ss:fff}", Now)
End Sub
Option 3: Use
Server-Side Mode (Disable Load-On-Demand)
If updating other controls is critical, disable load-on-demand and let RadAjaxPanel handle all updates:
<telerik:RadComboBox ID="cboCustomer" runat="server"
Width="500px"
AllowCustomText="true"
AutoPostBack="true"
DataTextField="custname"
DataValueField="custnmbr"
EnableAutomaticLoadOnDemand="false"
Filter="Contains">
</telerik:RadComboBox>
Then use TextChanged or SelectedIndexChanged events (which
already work) to update controls.
Recommended
Approach
|
Scenario
|
Recommended Option
|
|
Simple
UI updates (colors, text)
|
Option
1 -
Client-side JavaScript
|
|
Complex
server-side logic needed
|
Option
2 -
Hidden button AJAX postback
|
|
Small
dataset, performance not critical
|
Option
3 -
Disable load-on-demand
|
Summary
The ItemsRequested event
cannot update other controls via server-side code due to its dedicated callback
mechanism. Use client-side scripting (OnClientItemsRequested)
or trigger a separate AJAX postback to achieve the desired behavior.