item request event not firing

2 posts, 0 answers
  1. Anju
    Anju avatar
    2 posts
    Member since:
    May 2013

    Posted 06 May 2013 Link to this post

    I have a combobox that placed inside a radwindow. Item request event of the combobox not working.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 06 May 2013 Link to this post

    Hi Anju,

    The ItemsRequested event occurs when the EnabledLoadOnDemand property is True and the user types text into the input field or clicks on the drop-down toggle image when the list is empty. Check whether you have enabled the LoadOnDemand property of the RadComboBox. Please have a look at the following sample code I tried which works fine at my end.

    ASPX:
    <telerik:RadWindow ID="RadWindow1" runat="server">
        <ContentTemplate>
            <telerik:RadComboBox ID="RadComboBox1" runat="server" EnableLoadOnDemand="true" OnItemsRequested="RadComboBox1_ItemsRequested"
                Style="margin: 20px 20px 20px 20px;">
            </telerik:RadComboBox>
        </ContentTemplate>
    </telerik:RadWindow>
    <telerik:RadButton ID="RadButton" runat="server" Text="Open RadWindow" OnClientClicked="OnClientClicked"
        AutoPostBack="false">
    </telerik:RadButton>

    C#:
    protected void RadComboBox1_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
    {
        RadComboBox1.Items.Add(new RadComboBoxItem("Item1", "1"));
        RadComboBox1.Items.Add(new RadComboBoxItem("Item2", "2"));
        RadComboBox1.Items.Add(new RadComboBoxItem("Item3", "3"));
    }

    JavaScript:
    <script type="text/javascript">
        function OnClientClicked(sender, args) {
            var radWindow1 = $find("<%= RadWindow1.ClientID %>");
            radWindow1.show();
        }
    </script>

    Thanks,
    Princy.
Back to Top