Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2004

Tip: Looking for answers? Try searching our database.

How To: Display objects in a PropertyGrid DropDown list?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve - 28 Feb 2004 00:04 GMT
I followed the MSDN example that uses a StringConverter to display states
(like Ohio, Florida,) in a PropertyGrid using a DropDown list. This works
fine for strings, but I would like to do this with objects I create on the
fly.

I think I have to create a custom TypeConverter, but I'm not sure how. Any
examples would be helpful.

Thanks,

Steve
Frank Hileman - 28 Feb 2004 00:30 GMT
Hello Steve,

You need a custom UITypeEditor, that overrides GetEditStyle, and returns
UITypeEditorEditStyle.DropDown. Then you override EditValue, and have that
function create a custom form of your own creation. Be sure to use a
PropertyDescriptor (via TypeDescriptor) to change the final property, so you
get a designer transaction, and the OnComponentChanging/OnComponentChanged
functions are called automatically for your property.

Look for articles by Shawn Burke, especially the one with "RAD" in the
title, for more info on the property grid.

Regards,
Frank Hileman

check out VG.net: www.vgdotnet.com
Animated vector graphics system
Integrated VS.net graphics editor

> I followed the MSDN example that uses a StringConverter to display states
> (like Ohio, Florida,) in a PropertyGrid using a DropDown list. This works
[quoted text clipped - 7 lines]
>
> Steve
Herfried K. Wagner [MVP] - 28 Feb 2004 00:54 GMT
Frank,

* "Frank Hileman" <frankhil@no.spamming.prodigesoftware.com> scripsit:
> You need a custom UITypeEditor, that overrides GetEditStyle, and returns
> UITypeEditorEditStyle.DropDown. Then you override EditValue, and have that
[quoted text clipped - 5 lines]
> Look for articles by Shawn Burke, especially the one with "RAD" in the
> title, for more info on the property grid.

A very interesting article on the PropertyGrid can be found here:

<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/u
singpropgrid.asp
>

Signature

Herfried K. Wagner [MVP]
<http://dotnet.mvps.org/>
Website Address Changed!

SVD - 29 Feb 2004 10:33 GMT
With coded examples?

Thanks,

Steve
Joerg Jooss - 29 Feb 2004 12:25 GMT
> With coded examples?

No book, but a nice article on MSDN:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/u
singpropgrid.asp


Cheers,

Signature

Joerg Jooss
joerg.jooss@gmx.net


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.