471,319 Members | 2,689 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,319 software developers and data experts.

Display properties in PropertyGrid


Hi, NG!
Does anyone have any hint on how to get the PropertyGrid control to display
more user-friendly "property" names, i.e. names that contain spaces, just
the way the VS IDE does when you select a file in Solution Explorer to view
its properties ("Build Action", "Copy to Output Directory" etc)? How are
those strings displayed since they don't seem to be real property names as
they contain spaces? I'm trying to achieve this in C#...

Thanks in advance.

pax
Dec 19 '05 #1
5 5660
If you are trying to display properties for a class you control you can
implement the ICustomeTypeDescriptor interface found in the
System.ComponentModel namespace, override the GetProperties() and create
your own PropertyDescriptors overriding the DisplayName property.

Gabriel Lozano-Morán
MCSD .NET
Real Software
http://www.realdn.net
http://www.realsoftware.be

<pax> wrote in message news:ua****************@TK2MSFTNGP14.phx.gbl...

Hi, NG!
Does anyone have any hint on how to get the PropertyGrid control to display more user-friendly "property" names, i.e. names that contain spaces, just
the way the VS IDE does when you select a file in Solution Explorer to view its properties ("Build Action", "Copy to Output Directory" etc)? How are
those strings displayed since they don't seem to be real property names as
they contain spaces? I'm trying to achieve this in C#...

Thanks in advance.

pax

Dec 19 '05 #2
Thanks a lot, Gabriel. There's a lot of information in your swift reply, I
hope I'll be able to find my way through...
And yes, the class should be mine, I guess there would be nothing to expect
if it were not mine.

Thanks.
pax

"Gabriel Lozano-Morán" <gl*****@no-spam.org> wrote in message
news:OT**************@tk2msftngp13.phx.gbl...
If you are trying to display properties for a class you control you can
implement the ICustomeTypeDescriptor interface found in the
System.ComponentModel namespace, override the GetProperties() and create
your own PropertyDescriptors overriding the DisplayName property.

Gabriel Lozano-Morán
MCSD .NET
Real Software
http://www.realdn.net
http://www.realsoftware.be

<pax> wrote in message news:ua****************@TK2MSFTNGP14.phx.gbl...

Hi, NG!
Does anyone have any hint on how to get the PropertyGrid control to

display
more user-friendly "property" names, i.e. names that contain spaces, just the way the VS IDE does when you select a file in Solution Explorer to

view
its properties ("Build Action", "Copy to Output Directory" etc)? How are
those strings displayed since they don't seem to be real property names as they contain spaces? I'm trying to achieve this in C#...

Thanks in advance.

pax


Dec 19 '05 #3
Gabriel Lozano-Morán wrote:
If you are trying to display properties for a class you control you can
implement the ICustomeTypeDescriptor interface found in the
System.ComponentModel namespace, override the GetProperties() and create
your own PropertyDescriptors overriding the DisplayName property.

Gabriel Lozano-Morán
MCSD .NET
Real Software
http://www.realdn.net
http://www.realsoftware.be

<pax> wrote in message news:ua****************@TK2MSFTNGP14.phx.gbl...
Hi, NG!
Does anyone have any hint on how to get the PropertyGrid control to


display
more user-friendly "property" names, i.e. names that contain spaces, just
the way the VS IDE does when you select a file in Solution Explorer to


view
its properties ("Build Action", "Copy to Output Directory" etc)? How are
those strings displayed since they don't seem to be real property names as
they contain spaces? I'm trying to achieve this in C#...

Thanks in advance.

pax


Here's what I found a year ago when implementing property grid
customizations:

http://www.codeproject.com/vb/net/us...opertygrid.asp
http://www.codeproject.com/cs/miscct...ectiondata.asp
http://www.codeproject.com/vb/net/Pr...rid_Editor.asp
http://www.codeproject.com/csharp/Dz...tionEditor.asp

http://stup.org/blogs/nidhogg/archiv...02/18/279.aspx
http://www.codeproject.com/cs/miscctrl/DynPropGrid.asp

HTH,
Andy
--
To email me directly, please remove the *NO*SPAM* parts below:
*NO*SPAM*xmen40@*NO*SPAM*gmx.net
Dec 19 '05 #4
An example found using google:
http://216.239.59.104/search?q=cache...playname&hl=nl

Gabriel
Dec 19 '05 #5

Thank you very much, Andreas.
"Andreas Mueller" <me@privacy.net> wrote in message
news:40*************@individual.net...
Gabriel Lozano-Morán wrote:
If you are trying to display properties for a class you control you can
implement the ICustomeTypeDescriptor interface found in the
System.ComponentModel namespace, override the GetProperties() and create
your own PropertyDescriptors overriding the DisplayName property.

Gabriel Lozano-Morán
MCSD .NET
Real Software
http://www.realdn.net
http://www.realsoftware.be

<pax> wrote in message news:ua****************@TK2MSFTNGP14.phx.gbl...
Hi, NG!
Does anyone have any hint on how to get the PropertyGrid control to


display
more user-friendly "property" names, i.e. names that contain spaces, justthe way the VS IDE does when you select a file in Solution Explorer to


view
its properties ("Build Action", "Copy to Output Directory" etc)? How are
those strings displayed since they don't seem to be real property names asthey contain spaces? I'm trying to achieve this in C#...

Thanks in advance.

pax


Here's what I found a year ago when implementing property grid
customizations:

http://www.codeproject.com/vb/net/us...opertygrid.asp
http://www.codeproject.com/cs/miscct...ectiondata.asp
http://www.codeproject.com/vb/net/Pr...rid_Editor.asp
http://www.codeproject.com/csharp/Dz...tionEditor.asp

http://stup.org/blogs/nidhogg/archiv...02/18/279.aspx
http://www.codeproject.com/cs/miscctrl/DynPropGrid.asp

HTH,
Andy
--
To email me directly, please remove the *NO*SPAM* parts below:
*NO*SPAM*xmen40@*NO*SPAM*gmx.net

Dec 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Peter Verburgh | last post: by
reply views Thread by ljlevend | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.