Object reference not set to an instance of an object popup

18 posts, 1 answers
  1. Ratzai
    Ratzai avatar
    14 posts
    Member since:
    Oct 2007

    Posted 17 Oct 2012 Link to this post

    I have problem with the AutoCompleteBox where i get an Object reference not set to an instance of an object error in popup.

    I have the placed the control inside a DetailsView like this

    <InsertItemTemplate>
     <telerik:RadComboBox ID="CmbChemicalsInsertMode" CheckBoxes="true" Filter="Contains" HighlightTemplatedItems="true" ExpandDirection="Up" MarkFirstMatch="true" AllowCustomText="true" DataTextField="Name" EmptyMessage="Vælg stoffer" Runat="server">
    </telerik:RadComboBox>
     <asp:ImageButton ID="BtnAddChemical" CausesValidation="false" ToolTip="Tilføj valgte" width="15px" height="15px" ImageUrl="~/Images/plus.png" OnClick="BtnAddChemical_Click" runat="server" ></asp:ImageButton>
    <telerik:RadTextBox ID="TxtDeclaration" TextMode="MultiLine" Rows="5" Text='<%# DataBinder.Eval(Container, "DataItem.Declaration") %>' Runat="server" Skin="Metro"
                  Width="170px" />
                   
     <telerik:RadAutoCompleteBox ID="RACBChemicals"  InputType="Token" AllowCustomEntry="true" Skin="Metro" DataTextField="Name" DropDownWidth="400"
        DropDownHeight="250" Runat="server"></telerik:RadAutoCompleteBox>
    </InsertItemTemplate>

    The detailsview is located inside a RadWindow. As soon as i start typing something in the field, i get the previous mentioned popup error.
    As soon as i try to move the AutoCompleteBox outside of the DetailsView, the error stops and the control works fine

  2. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 17 Oct 2012 Link to this post

    Hello Ratzai,

    Please set the DataSource, DataTextField and DataValueField properties of the RadAutoCompleteBox.

    Regards,
    Kalina
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ratzai
    Ratzai avatar
    14 posts
    Member since:
    Oct 2007

    Posted 17 Oct 2012 Link to this post

    Hi Kalina,

    I have been working all day, but not that much so i forgot to set a datasource :-) The datasource is set in code-behind, and i do not use any datavaluefield
  5. Answer
    Bimar
    Bimar avatar
    20 posts
    Member since:
    Jan 2006

    Posted 08 Nov 2012 Link to this post

    Hi All.
    The autocompletetextbox control triggers page load every time you type on the control - even if you wrap the control with an update panel -
    So,  you must bind the datasource in the "PAGE_LOAD" method in order to solve this problem

    Best Regards

    Serkan APUL
  6. Ratzai
    Ratzai avatar
    14 posts
    Member since:
    Oct 2007

    Posted 09 Nov 2012 Link to this post

    Thank you very much Serkan!
    I wasn't aware that the control triggered a postback after each entry adding. 
    Problem fixed :)
  7. DuelingCats
    DuelingCats avatar
    49 posts
    Member since:
    Jul 2012

    Posted 13 Dec 2012 Link to this post

    Seems like rather odd behavior. Is this a bug?
  8. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 17 Dec 2012 Link to this post

    Hello DuelingCats,

    The message "Object reference not set to an instance of an object popup" is displayed in cases there is no DataSource assigned to the RadAutoCompleteBox.
    In our latest internal build we have replaced this message with more a clear message: "DataSource not set"

    Regards,
    Kalina
    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.
  9. DuelingCats
    DuelingCats avatar
    49 posts
    Member since:
    Jul 2012

    Posted 17 Dec 2012 Link to this post

    Thanks for the reply, but I was talking about the postback on each character entered. I understand that if you had a potentially huge dataset, you would not want to post the entire set to the client in a javascript object. However, if dataset is maybe just a couple of hundred records, I would rather set this datasource once and have the client receive the entire dataset on load. This would eliminate the postback with every keystroke and have the autocompletebox use javascript to filter through the dataset on the client's machine. 

    This was the situation I was in and ended up removing the autocompletebox to eliminate postback with every keypress. 
  10. Martin
    Martin avatar
    3 posts
    Member since:
    Sep 2011

    Posted 28 Feb 2013 Link to this post

    Hi Guys,

    The below suggestion does not seem to work for me.
    ---------------------------
    Message from webpage
    ---------------------------
    Object reference not set to an instance of an object.0|
    ---------------------------
    OK  
    ---------------------------
  11. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 05 Mar 2013 Link to this post

    Hello Martin,

    Could you elaborate a bit more on the faced issue? In addition, could you provide us with the implementation of the RadAutoCompleteBox that you use at your end?

    Regards,
    Nencho
    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.
  12. Jim
    Jim avatar
    7 posts
    Member since:
    Oct 2012

    Posted 08 May 2013 Link to this post

    I am also interested in the postback on each character entered behavior.  Is this a bug. Can this behavior be modified, a.k.a. stopped
  13. Shaw
    Shaw avatar
    13 posts
    Member since:
    Sep 2011

    Posted 10 May 2013 Link to this post

    I would also like to add my support to the control not doing a postback after each character for future versions. 

    I had the same probably originally setting my datasource only once and it is fixed now but I think it would be better if it did not require a post back each time.
  14. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 13 May 2013 Link to this post

    Hello,

    The specified behavior is by design. When certain character is typed in the input of the RadAutoCompleteBox, a callback is initiated, in order to perform a request to the database and extract the data, based on the typed text. I would suggest you to use a WebService, like demonstrated in our online demo. Thus a request to the Web Service would be initiated, instead of the previously mentioned callback.

    Kind regards,
    Nencho
    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.
  15. Tim
    Tim avatar
    2 posts
    Member since:
    Feb 2014

    Posted 30 Jun 2014 Link to this post

    I have to say, telling people requesting a change that the behavior is by design and won't be changed is not the ideal response.

    I too would like to request option to turn off postback for each character typed.  In my case it would be a far more costly operation to generate search suggestions during typing as opposed to loading the entire set once and initially.

    Thanks,
    Tim
  16. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 03 Jul 2014 Link to this post

    Hello Tim,

    There is a scenario, where you could avoid triggering callback each type when a charter is typed - when the ClientFiltering of the control is enabled. However, please keep in mind that when this property is enabled the entire datasource is initially requested and loaded.

    Please refer to the following documentation article, describing in details the behavior when the EnableClientFiltering property of the RadAutoCompleteBox is set to true:

    http://www.telerik.com/help/aspnet-ajax/autocompletebox-client-filtering.html

    Regards,
    Nencho
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  17. Tim
    Tim avatar
    2 posts
    Member since:
    Feb 2014

    Posted 03 Jul 2014 in reply to Nencho Link to this post

    Aha, well this is interesting.  First, thanks for mentioning that this property is now available.  Second - and this would be my error - I thought I was reading thread about RadSearchBox, not AutoCompleteBox, so applying this property to the latter doesn't work.  Any insights on how to get similar non-each-character-posting-back behavior in RadSearchBox?

    My apologies for not noticing this detail previously.

    Thanks,
    Tim
  18. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 08 Jul 2014 Link to this post

    Hello Tim,

    I would suggest you to use RadClientDataSource in order to populate the RadSearchBox with data. With such binding you could avoid triggering the callbacks each time the user types/deletes characters from the input of the control. Please refer to the following online demo which demonstrates the behavior and the implementation of the aforementioned binding approach.

    http://demos.telerik.com/aspnet-ajax/searchbox/examples/client-side-data-binding/defaultcs.aspx

    In addition, I have created a public item for a feature request, in order to implement the ClientFiltering with the RadSearchBox, which you could vote for and track here :

    http://feedback.telerik.com/Project/108/Feedback/Details/133046-add-clientfiltering-feature-to-the-radsearchbox-control


    Regards,
    Nencho
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  19. Martin
    Martin avatar
    3 posts
    Member since:
    Sep 2011

    Posted 25 Aug 2014 in reply to Nencho Link to this post

    Hi there

    Don't worry I managed to get it working.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017