Click here to Skip to main content
13,095,445 members (65,891 online)
Click here to Skip to main content
Add your own
alternative version


33 bookmarked
Posted 12 Jan 2004

Bending .NET PropertyGrid to your will with a Custom Type Editor

, 12 Jan 2004
Rate this:
Please Sign up or sign in to vote.
Example of using the propertybag class of Tony Allowatt in with a custom type editor

Sample Image - Propertygrid_Editor_demo.jpg


I've had serious trouble doing these two things:

  • Using a propertygrid and having all of its properties (like the names of the properties, and description that is shown) dynamic, in VB.NET
  • Using Tony Allowat's classes (which solves the first problem) with a custom type editor

I finally managed to get things working ... and thought that others amongst you could be having the same problem as I ... So here it is, my working VB.NET version of Tony Allowatt's propertybag classes, implementing a custom type editor.


I didn't write the code of the PropertyBag.vb file ... Tony Allowatt wrote these usefull classes for the propertygrid, but in C#. Read his article first! Bending the .NET PropertyGrid to Your Will

Using the code

I'm not going to explain much in here, as all the serious code has been explained by Tony Allowatt in his article. I only provide an example of how to use his classes with a custom editor.

Public Class MyOwnClass
 ' the class that will be shown in the propertygrid
 ' it has a property of typ MultiLineString
End Class 

Public Class MultiLineString
 ' this is the custom type we'll want to edit in the propertygrid
 ' it's just a class with 1 property, a string, but 
 ' we want a multiline editor for it

 ' ...
End Class

Public Class MultiLineStringEditor
 Inherits UITypeEditor
 ' ...
End Class

Public Class MultiLineStringConverter
 Inherits System.ComponentModel.TypeConverter
 ' ...
End Class

Public Class MultiLineStringEditorForm
 Inherits System.Windows.Forms.Form
 ' ...
End Class

Points of interest

Some interesting links:


  • 14-01-2004 - Initial Release


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
Belgium Belgium
No Biography provided

You may also be interested in...


Comments and Discussions

GeneralMy vote of 1 Pin
Member 83787696-Oct-13 23:13
memberMember 83787696-Oct-13 23:13 
GeneralEasier Way Pin
bcryner27-Oct-08 5:48
memberbcryner27-Oct-08 5:48 
GeneralProperties are readonly... Pin
jack zucker28-Apr-05 10:46
memberjack zucker28-Apr-05 10:46 
GeneralRe: Properties are readonly... Pin
Spooler16-Sep-05 6:06
memberSpooler16-Sep-05 6:06 
Generalit does not really work Pin
zwark2-May-04 21:53
memberzwark2-May-04 21:53 
GeneralRe: it does not really work Pin
SoTTo2-May-04 22:45
memberSoTTo2-May-04 22:45 
GeneralRe: it does not really work Pin
zwark2-May-04 23:00
memberzwark2-May-04 23:00 
GeneralCollections Pin
TLWallace14-Apr-04 10:55
memberTLWallace14-Apr-04 10:55 
GeneralRe: Collections Pin
SoTTo14-Apr-04 12:02
memberSoTTo14-Apr-04 12:02 
GeneralDatabase example, please Pin
huuhaa23-Jan-04 0:42
memberhuuhaa23-Jan-04 0:42 
GeneralRe: Database example, please Pin
SoTTo25-Jan-04 7:44
memberSoTTo25-Jan-04 7:44 
GeneralFlat Toolbar Look Pin
Tom Spink20-Jan-04 6:29
memberTom Spink20-Jan-04 6:29 
GeneralRe: Flat Toolbar Look Pin
Anonymous21-May-04 0:18
sussAnonymous21-May-04 0:18 
GeneralRe: Flat Toolbar Look Pin
Tom Spink21-May-04 5:42
memberTom Spink21-May-04 5:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170813.1 | Last Updated 13 Jan 2004
Article Copyright 2004 by SoTTo
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid