More in this section

Forums / Developing with Sitefinity / Telerik.Lists.WebControls.ListSelector -Object reference not set to an instance of an object

Telerik.Lists.WebControls.ListSelector -Object reference not set to an instance of an object

3 posts, 0 answered
  1. Nigel
    Nigel avatar
    49 posts
    Registered:
    07 Jul 2008
    04 Aug 2009
    Link to this post
    Hi, I am implementing a property using the ListSelector but I am getting an error when I click select button in the toolbox control property editor.

    Object reference not set to an instance of an object.

    Object reference not set to an instance of an object.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [NullReferenceException: Object reference not set to an instance of an object.]
       Telerik.Cms.Web.UI.PropertyEditorDialog.GetEditor() +441
       Telerik.Cms.Web.UI.PropertyEditorDialog.CreateChildControls() +136
       System.Web.UI.Control.EnsureChildControls() +87
       System.Web.UI.Control.PreRenderRecursiveInternal() +44
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842
    


    The code that is creating the reference is:

            protected Guid[] _listsID;
            [TypeConverter("Telerik.Lists.WebControls.ListsIdsConverter, Telerik.Lists")]
            [WebEditor("Telerik.Lists.WebControls.ListSelector, Telerik.Lists")]
            public Guid[] Lists
            {
                get
                {
                    return _listsID;
                }
                set
                {
                    _listsID = value;
                }
            }

    Any ideas?

    Just for your information I have updated the Telerik.Web.UI to the new 2009 Q2 release.
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    06 Aug 2009
    Link to this post
    Hello Nigel,

    We have reproduced the error, and will try to provide you with an answer tomorrow. We will see if there is an easy fix.

    Sorry for the inconvenience. 

    Greetings,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  3. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    07 Aug 2009
    Link to this post
    Hello Nigel,

    Alright, here is the solution. The Lists selector should be now used in the following way:

    public partial class uc_UC : System.Web.UI.UserControl, Telerik.Lists.IListDisplay 
        protected void Page_Load(object sender, EventArgs e) 
        { 
     
        } 
        protected Guid[] _listsID; 
        [TypeConverter("Telerik.Lists.WebControls.ListsIdsConverter, Telerik.Lists")] 
        [WebEditor("Telerik.Lists.WebControls.ListSelector, Telerik.Lists")] 
        public Guid[] ListsIds 
        { 
            get 
            { 
                return _listsID; 
            } 
            set 
            { 
                _listsID = value; 
            } 
        } 
        string s; 
        public string ProviderName 
        { 
            get 
            { 
                return s; 
            } 
            set 
            { 
                s = value; 
            } 
        } 
     

    We have changed the selector, so more descriptive message will be thrown in the future if you use the selector in the old way. 

    Sincerely yours,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
Register for webinar
3 posts, 0 answered