Display property in PropertyGrid Control but not expose it

rbulph

Junior Contributor
Joined
Feb 17, 2003
Messages
397
Is there any way that I can display a property in the PropertyGrid Control but not expose it when I pass the object to a dll?
 
You can have a property appear on the property grid that is not actually part of the class by using a custom TypeDescriptor (check out some tutorials on customizing the property grid), but what is the actual problem you're trying to solve here? There's likely a better solution.
 
Hi, sorry for the delay in replying.

What I've got is like a piping diagram. Each pipe is an object which I draw on the screen and each of these pipes contains a business object with a number of properties. I pass these business objects to dlls. The contents of each pipe can be sourced from a number of preceding pipes. The user can select that a pipe is used as a source for a secondary one. He has a choice between having whatever it contains passing through the secondary pipe or just a selected portion of what it contains passing through. At propertygrid level I want the source pipe to be shown as a line item. At dll level I want the actual contents that are passed through to be accessible.

So I was thinking of having a function for the benefit of the dlls which returns the pipe contents and a property for my benefit which holds details of the relevant pipes which is visible to the propertygrid but not through dlls.

Hope that makes it a bit clearer. What do you think?
 
At propertygrid level I want the source pipe to be shown as a line item.
I'm not sure exactly how you want it represented in the property grid, but a tutorial on customizing the property grid (like this) should have all the info you need. It's not simple, but it's doable.
 
I'm not sure exactly how you want it represented in the property grid, but a tutorial on customizing the property grid (like this) should have all the info you need. It's not simple, but it's doable.

Indeed, I'm not exactly sure how I want to represent this in the grid either, but that link looks helpful, thanks.
 
Back
Top