Solved

CustomControl Loading time Problem

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
Viewers will learn the different options available in the Backstage view in Excel 2013.
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 …

760 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

20 Experts available now in Live!

Get 1:1 Help Now