Solved

CustomControl Loading time Problem

Posted on 2010-08-13
4
335 Views
Last Modified: 2012-05-10
Hello Experts,

I have an user control which I am adding pro grammatically to Window in a wrap Panel. Each Control shows some info about a product.

It works ok with upto 200 products but above that it is taking too long to render.

Can I load the control in a seperate thread or any other suggestion? Reading from database is quick but it takes long time in rendering.

Regards,
BjBM
0
Comment
Question by:brijbmishra
  • 2
  • 2
4 Comments
 
LVL 8

Expert Comment

by:SylvainDrapeau
ID: 33435953
Hello !

Do you use .SuspendLayout before adding your controls ?

See code below.

Syldra
Container.SuspendLayout()
For i = 0 to ControlsToBeAdded -1
Container.controls.add(...)
Next
Container.ResumeLayout()
Container.Refresh()

Open in new window

0
 

Author Comment

by:brijbmishra
ID: 33443193
Hello Syldra

Thanks for reply but I am working on WPF 4.0 and this suspend layout method is not available there.

Regards,
BjBM
0
 
LVL 8

Expert Comment

by:SylvainDrapeau
ID: 33451192
Hello !

Sorry, didn't get that in your question...

Take a look at this from StackOverflow : http://stackoverflow.com/questions/82847/in-wpf-what-is-the-equivelent-of-suspend-resumelayout-and-backgroundworker-f

Syldra
0
 

Accepted Solution

by:
brijbmishra earned 0 total points
ID: 33494726
Hello Experts,

I have solved this question, the best solution I was able to find was making my own panel using VirtualizingPanel.

Thanks for your support.

Regards,
BjBM
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Lync meeting or Lync conferencing is what many organizations would like to deploy to allow them save money. But companies are now giving up for various reasons, one of which is that they cannot join external meetings (non-federated company meetings)…
Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

803 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