![]() |
How to delete Item in PropertyGrid? |
Post Reply ![]() |
Author | |
wb197 ![]() Newbie ![]() Joined: 07 June 2005 Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() 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!
|
|
![]() |
|
wb197 ![]() Newbie ![]() Joined: 07 June 2005 Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() |
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?
|
|
![]() |
|
wb197 ![]() Newbie ![]() Joined: 07 June 2005 Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() |
The problem has been resolved! PropertyGrid.Categories.Clear method can remove all the child items.
|
|
![]() |
|
Aaron ![]() Senior Member ![]() Joined: 29 January 2008 Status: Offline Points: 2192 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
|
wb197 ![]() Newbie ![]() Joined: 07 June 2005 Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() |
OK, thanks a lot!
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |