Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Property Grid
  New Posts New Posts RSS Feed - How to delete Item in PropertyGrid?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to delete Item in PropertyGrid?

 Post Reply Post Reply
Author
Message
wb197 View Drop Down
Newbie
Newbie


Joined: 07 June 2005
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote wb197 Quote  Post ReplyReply Direct Link To This Post Topic: How to delete Item in PropertyGrid?
    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!
Back to Top
wb197 View Drop Down
Newbie
Newbie


Joined: 07 June 2005
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote wb197 Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
wb197 View Drop Down
Newbie
Newbie


Joined: 07 June 2005
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote wb197 Quote  Post ReplyReply Direct Link To This Post Posted: 08 April 2008 at 5:43am
The problem has been resolved! PropertyGrid.Categories.Clear method can remove all the child items.
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
wb197 View Drop Down
Newbie
Newbie


Joined: 07 June 2005
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote wb197 Quote  Post ReplyReply Direct Link To This Post Posted: 09 April 2008 at 10:58am
OK, thanks a lot!
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.250 seconds.