Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Property Grid
  New Posts New Posts RSS Feed - Childs remove item
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Childs remove item

 Post Reply Post Reply
Author
Message
JamesH View Drop Down
Senior Member
Senior Member


Joined: 01 December 2004
Status: Offline
Points: 147
Post Options Post Options   Thanks (0) Thanks(0)   Quote JamesH Quote  Post ReplyReply Direct Link To This Post Topic: Childs remove item
    Posted: 01 March 2005 at 1:33pm

Maybe I'm missing something, but if I have a PropertyGridItem object that I want to remove from a property grid I can get it's Parent and then the Remove call on the Parents Childs collection.   However, the remove method takes the index into the Childs collection, not the actual child object to remove.  Is there an easy way to get this index?  The only way I can see to do it is to loop through the entire Childs collection until the object is found.

Where I am baffled is how do I remove a top level catagory?   The PropertyGridItem will have a NULL parent so there is no Childs collection for me to remove from. 

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2005 at 11:53pm

You can use PropertyGrid.Categories collection as parent for top level category.

 

we will add PropertyGridItem.Remove() method in 9.60.1

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
JamesH View Drop Down
Senior Member
Senior Member


Joined: 01 December 2004
Status: Offline
Points: 147
Post Options Post Options   Thanks (0) Thanks(0)   Quote JamesH Quote  Post ReplyReply Direct Link To This Post Posted: 02 March 2005 at 4:43pm

Thanks for the reply Oleg,

Originally posted by oleg oleg wrote:

we will add PropertyGridItem.Remove() method in 9.60.1

While this would be useful in some situations, in my case it wouldn't actually be as useful.  I am removing an item and replacing it with the same item as a way to change the 'type' field.  Since type is read-only this is the only way I can think of to do it.  So just removing isn't enough, I need to know the index and collection so I can replace it.  (Ideally the type field wouldn't be read-only)

If multiple objects are selected and their properties are not the same for a field I display a text value "Varies" with a "..." button that will let them edit it.  When they hit "..." I remove the field and replace it with the apropraite int/double/bool/enum type.

Even if it doesn't fix my current situation, thank you for adding the PropertyGridItem.Remove() method in 9.60.1, I am sure it will come in useful in the future.

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.156 seconds.