This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I want to dynamically hide some properties in case another boolean property is set to false. Is this possible anyhow? Greetings, |
|
|
Hello One way to do this would be to iterate through the PropertyGrid.Nodes collection, find the node that represents the property you want to hide, and then remove that node from the collection. When iterating the collection, you can use the Node.Property or Node.Name properties to determine if it is the node you need to remove. Another option would be to make your model object implement the ICustomTypeDescriptor interface. This would allow you to customize what properties "exist" in various scenarios. Note that if you use this approach, the property grid can't detect when the property states change, so you'd need to use PropertyGrid.Refresh method to update the visuals. Let me know if you have any questions about any of these approaches. Jason Fauchelle |
|