Solved

CustomControl Loading time Problem

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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

This collection of functions covers all the normal rounding methods of just about any numeric value.
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
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…
Suggested Courses

615 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