Solved

CustomControl Loading time Problem

Posted on 2010-08-13
4
339 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
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 …
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

752 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