RadComboBox problem with requesting items

3 posts, 0 answers
  1. Petr
    Petr avatar
    18 posts
    Member since:
    Jul 2015

    Posted 23 Sep 2015 Link to this post

    Hi, I want to disable AllowCustomText in RadComboBox I find this article AllowCustomText Cannot Be Disabled When Loading Items on Demand and try to implement it. I set these property in my onLoad method​:

    EnableLoadOnDemand = false;
    EnableViewState = true;
    ShowMoreResultsBox = true;
    EnableVirtualScrolling = true;
    AppendDataBoundItems = true;
    ShowToggleImage = true;
    NoWrap = true;
    AllowCustomText = false;
    MarkFirstMatch = true;
    HighlightTemplatedItems = true;
    DropDownWidth = 350;
    MaxHeight = 250;
    Filter = RadComboBoxFilter.Contains;

    and register these events

    ItemsRequested += new RadComboBoxItemsRequestedEventHandler(comboItemsRequested);
    OnClientDropDownOpening = "OnClientComboBoxDropDownOpeningHandler";

    where client script is

    function OnClientComboBoxDropDownOpeningHandler(sender, eventArgs) {
       try {
     
           sender.requestItems("", false);
     
       } catch (e) {
           radalert(e.message + "<br>"+ e.stack)
       }
    }

    My combobox is defined in modal window so it is shown on user request and hide after selection. It works perfectly when I open it for the first time. But if I open combobox, hide the dialog and open it again then it doesn't work. Clicking on combobox doesn't start dropDown event and the script. For testing I add the same client script on event OnClientKeyPressing. It starts the script, but it throws this exception:

    b is undefined

    and stack trace:
    Telerik.Web.UI.ControlItem.prototype._initialize@http://localhost:60103/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_ctl00_ctl00_ctl00_ctl00_ContentBody_ContentMain_RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+Telerik.Web.UI%2c+Version%3d2013.3.1114.40%2c+:1978:1

    b.RadComboBox._createChildControls@http://localhost:60103/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_ctl00_ctl00_ctl00_ctl00_ContentBody_ContentMain_RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+Telerik.Web.UI%2c+Version%3d2013.3.1114.40%2c+:3850:1

    b.RadComboBox.prototype._createChildControls@http://localhost:60103/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_ctl00_ctl00_ctl00_ctl00_ContentBody_ContentMain_RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+Telerik.Web.UI%2c+Version%3d2013.3.1114.40%2c+:3317:1

    b.RadComboBox.prototype._ensureChildControls@http://localhost:60103/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_ctl00_ctl00_ctl00_ctl00_ContentBody_ContentMain_RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+Telerik.Web.UI%2c+Version%3d2013.3.1114.40%2c+:3318:67

    b.RadComboBox.prototype.requestItems@http://localhost:60103/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_ctl00_ctl00_ctl00_ctl00_ContentBody_ContentMain_RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+Telerik.Web.UI%2c+Version%3d2013.3.1114.40%2c+:4659:2

    OnClientComboBoxDropDownOpeningHandler@http://localhost:60103/Js/ContentClient/def_content_client.js?v=0.3.0.1:215:16 Sys.EventHandlerList.prototype.getHandler/<@http://localhost:60103/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_ctl00_ctl00_ctl00_ctl00_ContentBody_ContentMain_RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+Telerik.Web.UI%2c+Version%3d2013.3.1114.40%2c+:6:51366


    Do you have any idea what can be wrong?

    Thank you,
    Petr

  2. Petr
    Petr avatar
    18 posts
    Member since:
    Jul 2015

    Posted 25 Sep 2015 in reply to Petr Link to this post

    The problem is solved. I initialize data source in OnLoad method and it is not necessary to request items in event OnClientDropDownOpening anymore.

     Petr

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 28 Sep 2015 Link to this post

    Hello Petr,

    Thank you for sharing your solution with the community.

    Regards,
    Nencho
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top