Solved

virtualization of control

Posted on 2011-09-06
10
282 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to dynamically set the form action using jQuery.

746 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

12 Experts available now in Live!

Get 1:1 Help Now