Print Page | Close Window

How to delete Item in PropertyGrid?

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=10137
Printed Date: 24 November 2024 at 1:17am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to delete Item in PropertyGrid?
Posted By: wb197
Subject: How to delete Item in PropertyGrid?
Date Posted: 08 April 2008 at 4:21am
As a newbie with PropertyGrid ActiveX, I checked the C# and VB.Net sample of PropertyGrid. I didn't find how to delete the Items in PropertyGrid. Although PropertyGridItem object has a Remove method, I just want to clear the PropertyGrid and rebind PropertyGrid to another object. So some one please help me, thanks!



Replies:
Posted By: wb197
Date Posted: 08 April 2008 at 5:35am
PropertyGridItem has a Remove method, so maybe I should iterate all the items in PropertyGrid and call the Remove method.
Then the question now is how to iterate these items?


Posted By: wb197
Date Posted: 08 April 2008 at 5:43am
The problem has been resolved! PropertyGrid.Categories.Clear method can remove all the child items.


Posted By: Aaron
Date Posted: 08 April 2008 at 7:02am
Hi,
 
If you still need to iterate through the items you can use
 
for each propItem in wndPropertyGrid.Categories(1).Childs 
    if propItem.Childs.Count > 0 then  
        for each propItemChild in propItemChild.Childs
           and so on......
 
Declare variable propItem an propItemChild as PropertyGridItem


Posted By: wb197
Date Posted: 09 April 2008 at 10:58am
OK, thanks a lot!



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