Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CustomControl Loading time Problem

Posted on 2010-08-13
4
Medium Priority
?
343 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

722 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