Strange AJAX behavior

2 posts, 0 answers
  1. Reuven
    Reuven avatar
    19 posts
    Member since:
    Jun 2009

    Posted 27 Sep 2010 Link to this post

    I have an AJAXed radgrid with some nestedTemplates where in one there is a panel that I'm generating a lookup request, basically have a search box and a listview that I want populated based on the search term. I initially tried to do this with a Texbox and the TextChanged event, which worked fine, except the postback only occurs on the focus being lost (I tried to hook the onkeydown event, but the manager is on a master page and was having a hard time linking). So then I tried a radcombobox and on the ItemRequested event, bind the listview, which is successful with items, but the listview doesn't get updated on the page (I concurrently update the combobox's items list which works fine)

    Any suggestions?

  2. Veli
    Veli avatar
    2002 posts

    Posted 30 Sep 2010 Link to this post

    Hello Reuven,

    You cannot use RadComboBox's ItemsRequested event, because this makes client page callbacks. During client callbacks, the page does not go through its regular page life cycle and the page content is not updated. Only the caller of the callback receives the callback result. So, even though you have the server-side controls initialized on a page callback, their state is not maintained and the changes are not sent to the client.

    If I understand you correctly, you need to implement a search box where the results get dynamically re-updated when the user types. To do that, you need to use RadAjaxManager's client-side object to dynamically initiate AJAX request. Using the manager's server-side AjaxRequest event, you can handle the search operation and update the listview. Note that to setup this scenario, you need to define an AJAX setting where RadAjaxManager updates RadListView.

    I have attached a sample test page demonstrating this approach.

    Sincerely yours,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top