RadListBox is null or not an object

5 posts, 0 answers
  1. Charlie
    Charlie avatar
    12 posts
    Member since:
    Nov 2014

    Posted 09 Apr 2015 Link to this post

    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

  2. Bozhidar
    Admin
    Bozhidar avatar
    1101 posts

    Posted 10 Apr 2015 Link to this post

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Charlie
    Charlie avatar
    12 posts
    Member since:
    Nov 2014

    Posted 13 Apr 2015 in reply to Bozhidar Link to this post

    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.

  5. Bozhidar
    Admin
    Bozhidar avatar
    1101 posts

    Posted 13 Apr 2015 Link to this post

    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.

     
  6. Unais
    Unais avatar
    5 posts
    Member since:
    Jan 2015

    Posted 24 Nov 2015 in reply to Bozhidar Link to this post

    Hello Bozhidar,

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

     

    Regards,

    Unaise

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017