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

Custom Control with RadComboBox postback issue

1 Answer 83 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Ron
Top achievements
Rank 1
Ron asked on 28 Feb 2012, 08:43 PM
Hi,

Im very new to this.. So please bear with my ignorance..
I have a Custom control that Contains a RadComboBox and a script(I didnt write the code)..
Only some of the Client Side properties of the Radcombobox have been exposed so far.. I want to
add an event on RadComboBox that will populate a Textbox (placed inside a UpdatePanel) when the SelectedIndex is changed..
I enabled autopostback on the radcontrol and added an event handling mechanism..

However, Whenever I try to click on a value in Radcombobox, I get an error in the WebResource_2.axd error..

Microsoft JScript runtime error: Object doesn't support property or method 'indexOf'

The following line is highlighted
if(Sys.Browser.agent===Sys.Browser.InternetExplorer){var y=j.indexOf("#");if(y!==d)j=j.substr(0,y);

Can someone please guide me on how do I resolve this error?


Here is the relevant code

...
public event EventHandler click;
 
        public void RaisePostBackEvent(string eventArgument)
        {
            click1(this, EventArgs.Empty);
        }
 
        public virtual void click1(object sender, EventArgs e) {
            if (click != null)
                click(this, e);
        }
 
        private readonly RadComboBox radCombo = new RadComboBox
                                           {
                                               EnableVirtualScrolling = true,
                                               EnableLoadOnDemand = true,
                                               MaxHeight = 300,
                                               Width = Unit.Percentage(100),
                                               ShowMoreResultsBox = true,
                                               ItemsPerRequest = 25,
                                               OnClientItemsRequesting = "comboSetContext",
                                               AutoPostBack = true
                                           };
 
        protected override void CreateChildControls()
        {
            radCombo.ID = ID + "_cb";
            radCombo.ExpandAnimation.Duration = 200;
            radCombo.CollapseAnimation.Duration = 200;
            radCombo.WebServiceSettings.Path = "/combo.ashx";
            radCombo.WebServiceSettings.UseHttpGet = true;
            radCombo.WebServiceSettings.Method = ComboHandler;
            radCombo.OnClientItemDataBound = "catComboItemDataBound";
            radCombo.ToolTip = ToolTip;
            if (string.IsNullOrEmpty(ComboHandler))
            {
                throw new Exception("Must specify a ComboHandler for CatComboBox " + ID);
            }
            Controls.Add(radCombo);
            Controls.Add(new ScriptBlock { Script = "$('#" + ClientID + "_cb_Input').keydown(comboEnterPressed);" });
        }

1 Answer, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 02 Mar 2012, 10:42 AM
Hi,

I've inspected the code snippet provided, but it's insufficient to determine what is causing this error. In order to troubleshoot this problem I would need  a runnable sample which I could debug locally, so please open a support ticket and provide such sample.

All the best,
Dimitar Terziev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
ComboBox
Asked by
Ron
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Share this question
or