473,757 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.componen tmodel 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_inch es". 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 1726

"Ger" <ge*********@ra thernospam.sail soft.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.componen tmodel 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_inch es". 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 "customizin g in the .NET framework" listed under "PropertyGr id control")

That article has more than could be reasonably posted here. Specifically
look at the DescriptionAttr ibute 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
CylinderCubicIn ches, so why not confirm to that?

Just my thought,

Cor

"Ger" <ge*********@ra thernospam.sail soft.nl> schreef in bericht
news:%2******** ********@TK2MSF TNGP10.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.componen tmodel 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_inch es". 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*******@usin ternet.com> schreef in bericht
news:ug******** ******@TK2MSFTN GP10.phx.gbl...

"Ger" <ge*********@ra thernospam.sail soft.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.componen tmodel 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_inch es". 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 "customizin g in the .NET framework" listed under "PropertyGr id

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

LFS

Nov 21 '05 #4
Ger
Cor, thanks for your reply.
I *am* using notations like "CylinderCubicI nches" 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
ICustomTypeDesc riptor, but that seems quite complex. Anyway I will study it
tomorrow.
Ger.

"Cor Ligthert" <no************ @planet.nl> schreef in bericht
news:uJ******** ******@TK2MSFTN GP09.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
CylinderCubicIn ches, so why not confirm to that?

Just my thought,

Cor

"Ger" <ge*********@ra thernospam.sail soft.nl> schreef in bericht
news:%2******** ********@TK2MSF TNGP10.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.componen tmodel 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_inch es". 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 "CylinderCubicI nches" 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
ICustomTypeDesc riptor, but that seems quite complex. Anyway I will study it
tomorrow.


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

--
Chris

dunawayc[AT]sbcglobal_lunch meat_[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
5702
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 now I use a DataGrid with 2 columns in it where the first one as the ReadOnly property property set to true.. it's quite ugly. if it's impossible then i'm open to any suggestions. :O)
2
14323
by: X.W. | last post by:
Hi group, I have a class like this: class Person { public uint Age { get{...} set{...} }
1
11885
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 samples of how to use the PropertyGrid control and have gained a decent understanding of it. But of course, as it usually the case, my needs go far beyond the simple examples shown in online samples. All the online samples show how to take a class...
2
4840
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. But, for complex property types (e.g., instance types) this does not work because System.ComponentModel.DefaultValue requires a constant value In order to indicate if a property should be serialized you can include a boolean function named...
0
1223
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 SelectedObject property. Whenever a Dlinq object is bound, and a particular EntityRef object within that class cannot be obtained from a query, it throws a EmptySequenceException. This is really not an issue from a "get" perspective, i.e. when an
7
3850
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 grid and put a dynamic "Name" property in there without having a class with a name property "fed" to it? Thanks Ron
4
3304
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; fPersonSurName : String; fPersonAge : Integer; published property PersonName : String read fPersonName write fPersonName;
0
841
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 declaration. How can I use a word like "Size of Tick" as a property instead of "Size_of_Ticks"? Is it possible that the seenable property name in the PropertyGrid is overwritten (only as a caption) and the name of the variables stay? ...
4
5448
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 next Thank you Public class frmColor Dim xColors As New myColors
0
9487
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9297
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10069
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8736
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6556
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5324
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3828
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2697
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.