Print Page | Close Window

LockRedraw property

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=7857
Printed Date: 27 November 2024 at 7:39am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: LockRedraw property
Posted By: PatS
Subject: LockRedraw property
Date Posted: 22 August 2007 at 12:03pm

When I set the LockRedraw property = True prior to adding PropertyGridItem objects to the Property grid control and then set it to False afterwards, I'm seeing a crash.  I'd like to use this property to try to increase the performance of my app.  If I remove the lines of code that set the LockRedraw property, the code runs fine.  Has anyone else seen this?  Any known workarounds?

I'm using v11.1.3 of the PropertyGrid control.
 
Thanks,
Pat



Replies:
Posted By: PatS
Date Posted: 22 August 2007 at 12:19pm
I've found that if I call the .Categories.Clear method before setting the .LockRedraw property = False, the code does not crash. 
 
Even with this workaround, this should still be investigated by the Codejock development team.


Posted By: Baldur
Date Posted: 27 March 2008 at 12:26pm

I have had the same problem.

If i store a reference of a propertyitem for faster access and clear than the cateogrychilds, i get also a crash.
I have to clear all reference to any propertyitem bevor i clear the childs !
Than i have no crash and it works fine.


Posted By: Aaron
Date Posted: 28 March 2008 at 7:43am
Hi,
 
You are talking about increasing the speed of your app. Are you adding that much items to the grid?
 
I'm (ab)using the grid for loading filenames from directories. While loading the filenames into the grid (multiple levels), the font/colors of the items will be changed, the files will be sorted on month and year and a few minor things. I did some tests and I found when loading about 1200 items: 
 
Without LockRedraw : between 0.65 - 0.69 sec
With LockRedraw : between 0.49 - 0.53 sec
 
This with a 800Mhz machine, I know yours will be faster... So why bother when you have to add less items?


Posted By: Baldur
Date Posted: 28 March 2008 at 2:34pm
I don't add many items, i store some references of added propertyitems in my own vars, so i don't need than Find-Methods.
 
I think for your application, the reportcontrol will be the better solution:
- support subrecords with +/- button like tree
- multiple columns
- also fonts and colors
- ownerdraw
 
The loading of 2000 records with 20 columns are done less 1 second.
Also you get more information in one control as in the propertygrid with 2 columns.


Posted By: Aaron
Date Posted: 30 March 2008 at 3:12am
Hi,
 
Baldur, I don't need more info or speed. This is just the control I need.
 
But this wasn't an issue, was it? PatS wanted to increase the app and I only wanted to give an indication how long it takes when adding 1200 items to the grid. The difference between LockRedraw = true and LockRedraw = false is about 0,2 seconds. So why bother using LockRedraw if your not adding lots of items?



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net