virtualization of control

Posted on 2011-09-06
Last Modified: 2013-11-12

I have created a listbox
<ListBox Margin="58,96,100,66"  Name="listBox1" VirtualizingStackPanel.IsVirtualizing="True" />

Open in new window

Now I am binding it from code behind
for (int i = 0; i < 1000000; i++)

Open in new window

Even I have set VirtualizingStackPanel.IsVirtualizing="True" even then why it takes a lot of time to load the list.

Please advice.

Karan Gupta
Question by:KaranGupta

Expert Comment

ID: 36493779

Expert Comment

ID: 36494497
How long is "long time" ?

Author Comment

ID: 36494701
3-4 seconds. The main concern is not time, but to see how virtualization helps in improving performance.
LVL 83

Expert Comment

ID: 36499226
Its a WPF question and you did not choose that zone for it!
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.


Expert Comment

ID: 36499439
Well.. Have you tried to disable Virtualization and see how long time it takes?


Author Comment

ID: 36500605

I tried to search it but could not find it.


It is taking the same time that is why I have asked this query.
LVL 28

Accepted Solution

sybe earned 250 total points
ID: 36902678
So you have a listbox with 1 million options in it.

What are you measuring?
The time to send those megabytes from server to client?
The time it takes the browser render such a listbox?

Because virtualization really makes no difference for those two.

If you want to measure the server-process only you will need to time it takes to generate the code. So compare begin (right before the loop) and end time (right after the loop) on the server.

LVL 26

Assisted Solution

by:Anurag Thakur
Anurag Thakur earned 250 total points
ID: 36902773
my assumption is that you are doing manual data binding and not setting the data source and then call the bind method
My assumption is that when you set the data source and do data bind then the virtualization will kick in and will only load desired set of records and not all the records at a time

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System ( introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now