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

RadListBox is null or not an object

4 Answers 128 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Charlie
Top achievements
Rank 1
Charlie asked on 09 Apr 2015, 09:43 AM

Hi everyone and firstly apologies if this post is in the wrong location but I am having issues with a couple of your controls. I have an asp page which used to use a dropdownlist to initially select a recipient which would then use its selectedValue as a select parameter for a datasource. On selectedindexchange I populate a radlistbox using the datasource. This all worked perfectly with no issues but I am now trying to introduce a radcombobox instead of the dropdownlist to allow me to search the items. The problem is on the selectedindexchange of the radcombobox I get a JScript runtime error 'Telerik.Web.UI.RadListBox' is null or not an object. I have updated the select parameters to use the new controls value and have tried a couple of things but cannot seem to resolve the issue. 

 

Please any support will be greatly appreciated.

Regards

Charlie

4 Answers, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 10 Apr 2015, 01:50 PM
Hello,

In order for us to help in troubleshooting the issue we would need some kind of sample that we can work on. Could you share the relevant part of your code, so that we can reproduce it on our end?

Regards,
Bozhidar
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Charlie
Top achievements
Rank 1
answered on 13 Apr 2015, 06:26 AM

Hi the dropdownlist and combobox both fire this code on selectedindexchange to databind the listbox:

DataView dv1 = (DataView)SqlDataSource8.Select(DataSourceSelectArguments.Empty);
            DataTable dt = dv1.ToTable();
            RadListBox1.Items.Clear();
            foreach (DataRow item in dt.Rows)
            {
                Telerik.Web.UI.RadListBoxItem it = new Telerik.Web.UI.RadListBoxItem(item[1].ToString(), item[0].ToString());
                it.Checked = Convert.ToBoolean(item[2]);
                RadListBox1.Items.Add(it);
            }

 

The code works fine for the dropdownlist and there are no code errors when manually running the breakpoint through the code its just the javascript that it fails in like seen in the screenshot above. I don't know if it makes any difference but I am using the standard asp scriptmanager as it is required as there is some underlaying javascript to control the layout of the pages as they are contained within a master page.

0
Bozhidar
Telerik team
answered on 13 Apr 2015, 10:46 AM
Hello,

We would also need the aspx code for the ComboBox and ListBox. Could you also clarify whether you are adding some of these controls dynamically to the page, or if you have any Ajax settings?

Regards,
Bozhidar
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Unais
Top achievements
Rank 1
answered on 24 Nov 2015, 11:09 AM

Hello Bozhidar,

                How can I rebind() data of a RadlistBox from codebehind. Please help me..

 

Regards,

Unaise

Tags
ListBox
Asked by
Charlie
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Charlie
Top achievements
Rank 1
Unais
Top achievements
Rank 1
Share this question
or