472,784 Members | 894 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Propertygrid, associate property name with textual name possible?

Ger
The propertygrid is a great control, but I would like to show a more
descriptive text for the properties in the control. I tried to find a
solution within the system.componentmodel but did not succeed.
As far as I know I can only show the user the property name I use in my
class, like "cubic_inches". I would like the user to see something like
"Cylinder cubic inches".
Is it in any way possible to associate a text to the name of the property
and show that text in the property grid instead of the "internal" name of
the property?
Thanks,
John
Nov 21 '05 #1
5 1665

"Ger" <ge*********@rathernospam.sailsoft.nl> wrote
The propertygrid is a great control, but I would like to show a more
descriptive text for the properties in the control. I tried to find a
solution within the system.componentmodel but did not succeed.
As far as I know I can only show the user the property name I use in my
class, like "cubic_inches". I would like the user to see something like
"Cylinder cubic inches".
Is it in any way possible to associate a text to the name of the property
and show that text in the property grid instead of the "internal" name of
the property?

Check out this article in VS Help:

Getting the Most Out of the .NET Framework PropertyGrid Control

(In VS Help; Show the Index, type in PropertyGrid, and scroll down
to "customizing in the .NET framework" listed under "PropertyGrid control")

That article has more than could be reasonably posted here. Specifically
look at the DescriptionAttribute for adding your descriptions.

LFS

Nov 21 '05 #2
Ger,

Have a look how Microsoft uses it. And than you see they use names as
DataSource, so for you that would be
CylinderCubicInches, so why not confirm to that?

Just my thought,

Cor

"Ger" <ge*********@rathernospam.sailsoft.nl> schreef in bericht
news:%2****************@TK2MSFTNGP10.phx.gbl...
The propertygrid is a great control, but I would like to show a more
descriptive text for the properties in the control. I tried to find a
solution within the system.componentmodel but did not succeed.
As far as I know I can only show the user the property name I use in my
class, like "cubic_inches". I would like the user to see something like
"Cylinder cubic inches".
Is it in any way possible to associate a text to the name of the property
and show that text in the property grid instead of the "internal" name of
the property?
Thanks,
John

Nov 21 '05 #3
Ger
Thank you Larry for your reply.
I did check that article earlier, but it provides no answer to my question.
I am not looking for a description, I know there is an attribute that
provides that as you also point out, but I would like to change the *name*
of the property in the propertygrid to be more descriptive to the user.
Ger.

"Larry Serflaten" <se*******@usinternet.com> schreef in bericht
news:ug**************@TK2MSFTNGP10.phx.gbl...

"Ger" <ge*********@rathernospam.sailsoft.nl> wrote
The propertygrid is a great control, but I would like to show a more
descriptive text for the properties in the control. I tried to find a
solution within the system.componentmodel but did not succeed.
As far as I know I can only show the user the property name I use in my
class, like "cubic_inches". I would like the user to see something like
"Cylinder cubic inches".
Is it in any way possible to associate a text to the name of the property and show that text in the property grid instead of the "internal" name of the property?

Check out this article in VS Help:

Getting the Most Out of the .NET Framework PropertyGrid Control

(In VS Help; Show the Index, type in PropertyGrid, and scroll down
to "customizing in the .NET framework" listed under "PropertyGrid

control")
That article has more than could be reasonably posted here. Specifically
look at the DescriptionAttribute for adding your descriptions.

LFS

Nov 21 '05 #4
Ger
Cor, thanks for your reply.
I *am* using notations like "CylinderCubicInches" in the grid. But I was
wondering if it was possible to make it more descriptive, and more flexible,
e.g. for localization purposes. In the mean time I found an example using
ICustomTypeDescriptor, but that seems quite complex. Anyway I will study it
tomorrow.
Ger.

"Cor Ligthert" <no************@planet.nl> schreef in bericht
news:uJ**************@TK2MSFTNGP09.phx.gbl...
Ger,

Have a look how Microsoft uses it. And than you see they use names as
DataSource, so for you that would be
CylinderCubicInches, so why not confirm to that?

Just my thought,

Cor

"Ger" <ge*********@rathernospam.sailsoft.nl> schreef in bericht
news:%2****************@TK2MSFTNGP10.phx.gbl...
The propertygrid is a great control, but I would like to show a more
descriptive text for the properties in the control. I tried to find a
solution within the system.componentmodel but did not succeed.
As far as I know I can only show the user the property name I use in my
class, like "cubic_inches". I would like the user to see something like
"Cylinder cubic inches".
Is it in any way possible to associate a text to the name of the property and show that text in the property grid instead of the "internal" name of the property?
Thanks,
John


Nov 21 '05 #5
On Sun, 28 Nov 2004 18:11:38 +0100, Ger wrote:
I *am* using notations like "CylinderCubicInches" in the grid. But I was
wondering if it was possible to make it more descriptive, and more flexible,
e.g. for localization purposes. In the mean time I found an example using
ICustomTypeDescriptor, but that seems quite complex. Anyway I will study it
tomorrow.


Using ICustomTypeDescriptor is the correct way to go. I have a class that
creates a "DisplayName" attribute to customize the name of the property in
the grid. If you're interested, let me know.

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Zoury | last post by:
Hi! Is it possible to use the PropertyGrid control without bind it to a control? As if it were a standard list? I would like to add "properties" in it but i never know what it will be. For...
2
by: X.W. | last post by:
Hi group, I have a class like this: class Person { public uint Age { get{...} set{...} }
1
by: ANDRES BECERRA | last post by:
Herfried K. Wagner was kind enough to point me to the PropertyGrid control http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemwindowsformspropertygridclasstopic.asp I have found a few...
2
by: Lance | last post by:
I want to be able to reset a complex property in a PropertyGrid. I know that for properties that are ValueTypes you can include System.ComponentModel.DefaultValue in the declaration of the property....
0
by: hammad.awan_nospam | last post by:
Hello, I have used SqlMetal to generate the Dlinq classes for my database schema. I have created instances of those classes and then tried binding them to a PropertyGrid object through it's...
7
by: Ron M. Newman | last post by:
Hi, Can the native PropertyGrid accept dynamic properties? ones that are not pre-compiled into a class and don't have those thingies attached to properties? Can I just instantiate a property...
4
by: Tugrul HELVACI | last post by:
Changing DisplayNames of my properties using PropertyGrid component, how ?? I'm using Delphi 2006 and I have a class defination like this: TPerson = class fPersonName : String;...
0
by: Peter Gast | last post by:
Hallo, I want do take a PropertyGrid a the UserInterface for the properties of a graphical diagramm. My problem is that the names of the property has to follow the rules of variable name...
4
by: Rohan | last post by:
I need to use the Collection editor of the propertyGrid, but i can't this to work, i looked around on the NET on collection and I am kinda lost. i have this so far, i don't know what i should do...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.