Childs remove item |
Post Reply |
Author | |
JamesH
Senior Member Joined: 01 December 2004 Status: Offline Points: 149 |
Post Options
Thanks(0)
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. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
JamesH
Senior Member Joined: 01 December 2004 Status: Offline Points: 149 |
Post Options
Thanks(0)
|
Thanks for the reply Oleg,
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. |
|
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 |