Link to home
Start Free TrialLog in
Avatar of brijbmishra
brijbmishra

asked on

CustomControl Loading time Problem

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
Avatar of Sylvain Drapeau
Sylvain Drapeau
Flag of Canada image

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

Avatar of brijbmishra
brijbmishra

ASKER

Hello Syldra

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

Regards,
BjBM
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
ASKER CERTIFIED SOLUTION
Avatar of brijbmishra
brijbmishra

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial