Is there a UITypeEditor for my controls?


Author
Message
Scott Bressette
Scott Bressette
StrataFrame Novice (119 reputation)StrataFrame Novice (119 reputation)StrataFrame Novice (119 reputation)StrataFrame Novice (119 reputation)StrataFrame Novice (119 reputation)StrataFrame Novice (119 reputation)StrataFrame Novice (119 reputation)StrataFrame Novice (119 reputation)StrataFrame Novice (119 reputation)
Group: Forum Members
Posts: 17, Visits: 53
I wrapped a StrataFrame combobox and made it so if the user hits the F5 key, it shows a browse dialog which allows them to go on to add, edit or delete the records found in that combobox. It is a great feature but it is prone to developer error because I need to get the type of the browse as a string in the property (which then I use some reflection code to turn back into a real browse dialog that I got from the BrowseDialog source code).



What I'd like to do is re-use the StrataFrame BusinessObject UITypeEditor that you see below, but change it from looking for BusinessObjects to looking for BrowseDialogs. That way, I can offer a nice dialog to pick BrowseDialogs instead of typing out the entire namespace and name in the property window.




Description("The type of business object that will be used in the browse."), _

Editor(Constants.TE_BrowseDialogEditor, GetType(UITypeEditor)), _

TypeConverter(Constants.TC_SystemTypeStringConverter)> _

Public Overrides Property BusinessObjectType() As String

<...The rest of it....>



I've looked at making my own UITypeEditor and this problem isn't bad enough to make me want to try it. I would much rather inherit from the MicroFour.StrataFrame.Extensibility namespace and just override a property or two. Unless someone knows an easier way to offer a dynamic list in the property window of controls you've created?
Replies
Scott Bressette
Scott Bressette
StrataFrame Novice (119 reputation)StrataFrame Novice (119 reputation)StrataFrame Novice (119 reputation)StrataFrame Novice (119 reputation)StrataFrame Novice (119 reputation)StrataFrame Novice (119 reputation)StrataFrame Novice (119 reputation)StrataFrame Novice (119 reputation)StrataFrame Novice (119 reputation)
Group: Forum Members
Posts: 17, Visits: 53
I’ll have to eat my hat on this one. I called another programmer over to confirm that I had done exactly as Greg suggested, I compiled it and went to show him how that it didn’t work for me. Of course this time, it worked exactly as Greg said it would.



I swear that I compiled it all and tried to make it work because I changed it between using the BusinessObject UITypeEditor and my BaseBrowse object, where one worked and the other didn’t. I saw it work with Textboxes too. If I was to venture any guess about what happened, it would be that I had been editing my BaseBrowse object for some other issues and that somehow confused my IDE yesterday.



Well, this will make many bugs disappear and make the code much more maintainable. Thank You Greg!



Scott

p.s. Trent, I would really appreciate seeing one of those type editors if you wouldn’t mind posting the code. It seems like you’d need some sort of reflection magic to make them work right, and I would really like to know how to do it.

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (11K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
LOL! I once spent an entire day attempting to figure out a bug, posting here, finally making a sample to reproduce....only it wouldn't. Eventually, the sample was a copy of the broken code and it worked. So, I went back and ran the broken code and it worked, even though I had changed nothing Crazy. Still have no idea what happened (probably some app domain thing). Glad you got it working!
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