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

Blinking ListBox on re-bind with Ajax

1 Answer 80 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 23 Feb 2015, 03:11 PM
I have three listboxes surrounded in ajax update panels that are populated by data I grab from a webrequest to a remote server.

On two of them, the data is returned in JSON and I parse it out by using a "For Each" to loop through the JSON add items to the listbox. The problem with my approach, I believe, is that I have to drop/clear all the items out of the listbox, and then rebind with fresh data. I do this every 3 to 5 seconds, as it is a chat-like program that needs real-time updates. Whats happening is that when moused-over, you can see items in the listbox flicker as they get rebound. I'm pretty sure it makes quite a bit of overhead, too.

My first theory in improving it would be to make the items dump into an radlistboxitemcollection and bind the listbox to that collection with "allowautomaticupdates" enabled, but I'm not even sure thats how that works.

Is there a better way to approach this? I can't really change how I pull the data much, just how I process it.

1 Answer, 1 is accepted

Sort by
0
Hristo Valyavicharski
Telerik team
answered on 25 Feb 2015, 01:46 PM
Hi Alex,

I suggest that you move the entire logic on the client. Populate the ListBox from a web service and rebind it on every 3-5 seconds or try to use Signal R to push notifications from the server. This way you should avoid flickering.

Regards,
Hristo Valyavicharski
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.

 
Tags
ListBox
Asked by
Alex
Top achievements
Rank 1
Answers by
Hristo Valyavicharski
Telerik team
Share this question
or