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

RadComboBox problem with requesting items

2 Answers 84 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Petr
Top achievements
Rank 1
Petr asked on 23 Sep 2015, 10:15 AM

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 Answers, 1 is accepted

Sort by
0
Petr
Top achievements
Rank 1
answered on 25 Sep 2015, 02:10 PM

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

 Petr

0
Nencho
Telerik team
answered on 28 Sep 2015, 06:46 AM
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
Tags
ComboBox
Asked by
Petr
Top achievements
Rank 1
Answers by
Petr
Top achievements
Rank 1
Nencho
Telerik team
Share this question
or