Trouble with TypeConverter


Author
Message
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!
Replies
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
That did indeed help with serialization, but not much else. I'm attaching a small project with the basics. If you get a chance, could take a quick look and see if you can spot anything glaringly wrong? I have a feeling I "that close" BigGrin
Attachments
ExpandableTypeConverterTest.zip (177 views, 20.00 KB)
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I know y'all are busy, but if anyone gets chance, I've love some feedback/correction about what I'm doing wrong with this type converter. Ermm
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
Sorry, Greg.  We have just been swamped lately.  We are in class this week (and actually next as well).  So things should return to normal the last week of the month...but I will really try to look at this one night.
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Totally understand. Hope training is going well (I'm sure it is). I wish I was there. Ermm I'm going to try for the next one. Thanks for any time you can spare to take a quick look.
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
OK....sorry for the REALLY long delay on this one.  But I have changed your code to work more in line with what I would do.  You will always want to have an instance of the object of some sort.  Instead of testing on Nothing, just test on a -1 for the ID or something along those lines.  You can also add a method on your TopMostNode item that tells if you it is in a default state to make this easier instead of writing the same thing over and over again (I did not write that method, but you get my point).
Attachments
ExpandableTypeConverterTest.zip (188 views, 78.00 KB)
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
No problem on the delay. Thanks I'll take a look at it! This is much appreciated. You guys rock! BigGrin
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I had a chance (finally) to look at this. I got it working quite easily using your changes as a guide! w00t



I see now that I needed to always have an instance of the property object (the TopMostNode), rather than using Nothing. Thanks again for the top notch support (above and beyond...). BigGrin
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
Cool...glad it worked out for you! Smile
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Greg McGuffey - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Greg McGuffey - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Greg McGuffey - 17 Years Ago
                         I know y'all are busy, but if anyone gets chance, I've love some...
Greg McGuffey - 17 Years Ago
                             Sorry, Greg. We have just been swamped lately. We are in class this...
Trent L. Taylor - 17 Years Ago
                                 Totally understand. Hope training is going well (I'm sure it is). I...
Greg McGuffey - 17 Years Ago
                                     OK....sorry for the REALLY long delay on this one. But I have changed...
Trent L. Taylor - 17 Years Ago
                                         No problem on the delay. Thanks I'll take a look at it! This is much...
Greg McGuffey - 17 Years Ago
                                             I had a chance (finally) to look at this. I got it working quite...
Greg McGuffey - 17 Years Ago
                                                 Cool...glad it worked out for you! :)
Trent L. Taylor - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search