This is a migrated thread and some comments may be shown as answers.

Opening the dropdown fails to fire ItemsRequested while EnableLoadOnDemand is true...

3 Answers 51 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Allen Smothers
Top achievements
Rank 2
Allen Smothers asked on 12 Nov 2009, 03:50 PM
Hello,

I'm having an issue with the Load-on-demand functionality of the RadComboBox.  I've set EnableLoadOnDemand="true" and have added OnItemsRequested="cbo1ItemsRequested" event.  The event gets fired if text is typed inside the dropdown box.  However, when I attempt to open the combobox via the arrow the event fails to fire and I'm left with an empty selection set.

Here is a copy of my aspx code:
<telerik:RadComboBox ID="cbo1" AutoPostBack="True" EnableViewState="False" Width="30em"    
   Font-Size="13px"  OnSelectedIndexChanged="cbo1_SelectedIndexChanged" 
   CausesValidation="false" OnPreRender="cbo1_PreRender" runat="server" Font-Bold="True" 
   HighlightTemplatedItems="True" MarkFirstMatch="true" EnableLoadOnDemand="true" OnItemsRequested="cbo1_ItemsRequested"
   <CollapseAnimation Duration="200" Type="OutQuint" /> 
      <ItemTemplate> 
         <table width="100%" cellpadding="0" cellspacing="0"
            <tr> 
              <td> 
                 <asp:Label ID="lblName" Font-Size="larger" Font-Bold="true" runat="server" 
                    Text='<%# DataBinder.Eval(Container.DataItem, "EntityName") %>' /> 
              </td> 
              <td style="text-align: right"
                 <asp:Panel ID="pnlImage" runat="server"
                    <asp:Image ID="imgForward" runat="server" ImageUrl="../images/icons/forward.gif" /> 
                 </asp:Panel> 
              </td> 
           </tr> 
       </table> 
   </ItemTemplate> 
</telerik:RadComboBox> 

Any ideas?

Thanks,
Allen

3 Answers, 1 is accepted

Sort by
0
Allen Smothers
Top achievements
Rank 2
answered on 12 Nov 2009, 09:19 PM
I've decide to forgo trying to use the EnableLoadOnDemand capabilities and instead try to load the dropdown when the user simply clicks on the dropdown's text or arrow.

This is my current plan of attack that seems to be failing...

I have a dropdown that I'm adding a single item and assigning on page load.  When the user click's on the dropdown I'm using an AjaxRequest to then populate the dropdown with the "On Demand" portion of the data.

In the Page_Load event I'm doing this...
RadAjaxManager ajaxProxy = RadAjaxManager.GetCurrent(Page); 
ajaxProxy.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(ajaxProxy_AjaxRequest); 
 
cboHEs.Attributes.Add("OnClick", RadAjaxManager.GetCurrent(Page).GetAjaxEventReference(cboHEs.ClientID)); 

Then I'm attempting to do populate the dropdown in the AjaxRequest event...
protected void ajaxProxy_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs evt) 
    if (evt.Argument == cboHEs.ClientID) 
        LoadHEs(); 

Any ideas or suggestions?

Thanks again,
Allen

0
Allen Smothers
Top achievements
Rank 2
answered on 16 Nov 2009, 03:53 PM
Any ideas?

-Allen
0
Veselin Vasilev
Telerik team
answered on 17 Nov 2009, 02:32 PM
Hi Allen Smothers,

We could not reproduce the original problem in our online demos. Can you? In all cases the items are loaded when the dropdown is opened. You can send us a sample project in a support ticket which demonstrates the issue. We will test it and find the reason.

Greetings,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
ComboBox
Asked by
Allen Smothers
Top achievements
Rank 2
Answers by
Allen Smothers
Top achievements
Rank 2
Veselin Vasilev
Telerik team
Share this question
or