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

Strange AJAX behavior

1 Answer 48 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Reuven
Top achievements
Rank 1
Reuven asked on 28 Sep 2010, 02:56 AM
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?

Thanks,
Reuven

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 30 Sep 2010, 12:41 PM
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,
Veli
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
Tags
Ajax
Asked by
Reuven
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or