Solved

virtualization of control

Posted on 2011-09-06
10
283 Views
Last Modified: 2013-11-12
Hi

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++)
{                
 listBox1.Items.Add(i.ToString());
}

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.

Regards
Karan Gupta
0
Comment
Question by:KaranGupta
10 Comments
 
LVL 8

Expert Comment

by:guvera
ID: 36493779
0
 
LVL 8

Expert Comment

by:databoks
ID: 36494497
How long is "long time" ?
0
 

Author Comment

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

Expert Comment

by:CodeCruiser
ID: 36499226
Its a WPF question and you did not choose that zone for it!
0
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.

 
LVL 8

Expert Comment

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

0
 

Author Comment

by:KaranGupta
ID: 36500605
CodeCruiser:

I tried to search it but could not find it.

databoks:

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

Accepted Solution

by:
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.

0
 
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
0

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 (http://www.experts-exchange.com/A_2902.html) 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