PC Review


Reply
Thread Tools Rate Thread

Display properties in PropertyGrid

 
 
Guest
Posts: n/a
 
      19th Dec 2005

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


 
Reply With Quote
 
 
 
 
Gabriel Lozano-Morán
Guest
Posts: n/a
 
      19th Dec 2005
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:uada%(E-Mail Removed)...
>
> 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
>
>



 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      19th Dec 2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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:uada%(E-Mail Removed)...
> >
> > 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
> >
> >

>
>



 
Reply With Quote
 
Andreas Mueller
Guest
Posts: n/a
 
      19th Dec 2005
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:uada%(E-Mail Removed)...
>
>>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
 
Reply With Quote
 
Gabriel Lozano-Morán
Guest
Posts: n/a
 
      19th Dec 2005
An example found using google:
http://216.239.59.104/search?q=cache...playname&hl=nl

Gabriel


 
Reply With Quote
 
Guest
Posts: n/a
 
      19th Dec 2005

Thank you very much, Andreas.


"Andreas Mueller" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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:uada%(E-Mail Removed)...
> >
> >>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



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
readonly properties when displaying an object's properties in propertygrid movieknight@gmail.com Microsoft VB .NET 0 14th May 2006 06:48 AM
Display properties in PropertyGrid Microsoft Dot NET Framework Forms 5 19th Dec 2005 07:17 PM
PropertyGrid sees only public properties Koen Microsoft Dot NET Framework 8 10th Feb 2005 06:01 PM
Hide properties in PropertyGrid rt Microsoft Dot NET Framework 3 8th Aug 2003 08:16 PM
PropertyGrid: show/hide properties at runtime? Todd Microsoft Dot NET Framework Forms 2 3rd Jul 2003 07:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:51 PM.