Trouble with TypeConverter


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
You can take the Null value into account within the TypeConverter and "pretend" it has a value.  Another option is to initialize the value to a blank or empty value, which is generally what is done most of the time.

The first place I would look would be the CanConvertFrom method and see if it is getting fired when Nothing (null) is being passed over...I would expect that it does.  If so, then you can take matters into you own hands and supply a value which should allow the designer to expand.

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I have a control that includes a property that is an object that has two properties within it, a string and an integer. I'd like this property to be an expandable property at design time in the property grid (like font, location, margins, ect are). I've figured out that I need a TypeConverter for the object and have built that. I figure out that I need to either override the GetPropertiesSupported and GetProperties methods or inherit from ExpandableObjectConverter (I've tried both) to get the parent object to expand into properties.



The problem is that when that property is Nothing (null), I can't expand it. Once I put in some appropriate text, then the plus sign shows up and the object's properties are expandable and shown. It is very likely something stupid, but how do I get the property to be expandable when the property is Nothing (null)?



Thanks!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search