473,748 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PropertyGrid "help on each property"

Someone introduced me to PropertyGrid last night. It is a great feature for
what I need. A question though. I noticed that when I assign a "TextBox"
control to a property grid the description on each property is shown at the
bottom of the grid. Also, properties are divided into categories.

How can I do this with my own defined objects?

For example: I would like Name to be in one category with a description for
it and Days to be in another category with a description for it.

public Class A
{
public enum Days {Mon, Tue, Wed, Thu, Fri};
private Days days;
private string name;
public Class A() {}
public Days WeekDays
{
get { return days; }
set { days = value; }
}
public string AName
{
get { return name; }
set { name = value; }
}
}
--
Steve
Nov 16 '05 #1
2 3415
Steve,

In order to place a property in a certain category, apply the Category
attribute to the property with the name of the category you want the
property to appear in. This will cause all properties with the same
category to be grouped together.

To display a description, apply the Description attribute to the
property, and then it will show that string in the propertygrid.

Both attributes are in the System.Componen tModel namespace.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Steve Teeples" <St**********@d iscussions.micr osoft.com> wrote in message
news:C0******** *************** ***********@mic rosoft.com...
Someone introduced me to PropertyGrid last night. It is a great feature
for
what I need. A question though. I noticed that when I assign a "TextBox"
control to a property grid the description on each property is shown at
the
bottom of the grid. Also, properties are divided into categories.

How can I do this with my own defined objects?

For example: I would like Name to be in one category with a description
for
it and Days to be in another category with a description for it.

public Class A
{
public enum Days {Mon, Tue, Wed, Thu, Fri};
private Days days;
private string name;
public Class A() {}
public Days WeekDays
{
get { return days; }
set { days = value; }
}
public string AName
{
get { return name; }
set { name = value; }
}
}
--
Steve

Nov 16 '05 #2
This was perfect! Thanks.

"Nicholas Paldino [.NET/C# MVP]" wrote:
Steve,

In order to place a property in a certain category, apply the Category
attribute to the property with the name of the category you want the
property to appear in. This will cause all properties with the same
category to be grouped together.

To display a description, apply the Description attribute to the
property, and then it will show that string in the propertygrid.

Both attributes are in the System.Componen tModel namespace.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Steve Teeples" <St**********@d iscussions.micr osoft.com> wrote in message
news:C0******** *************** ***********@mic rosoft.com...
Someone introduced me to PropertyGrid last night. It is a great feature
for
what I need. A question though. I noticed that when I assign a "TextBox"
control to a property grid the description on each property is shown at
the
bottom of the grid. Also, properties are divided into categories.

How can I do this with my own defined objects?

For example: I would like Name to be in one category with a description
for
it and Days to be in another category with a description for it.

public Class A
{
public enum Days {Mon, Tue, Wed, Thu, Fri};
private Days days;
private string name;
public Class A() {}
public Days WeekDays
{
get { return days; }
set { days = value; }
}
public string AName
{
get { return name; }
set { name = value; }
}
}
--
Steve


Nov 16 '05 #3

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

Similar topics

4
2042
by: Guido van Rossum | last post by:
I'm pleased to announce that the Python Software Foundation (PSF) is now accepting donations from individuals and companies interested in supporting our mission to improve the Python programming language. The PSF holds the intellectual property rights for Python and is working towards building a program to fund future Python development. Your donation will make a real difference in the quality of Python's future. For US individuals: ...
9
4105
by: Marcus Sheen [UK] | last post by:
Have done searches for similar questions, but cannot find anything. Nor can I find any resources via Google (Javascript Source etc). Thinking about implementing a topical "On This Day" feature on my site, where there would be a paragraph produced by Javascript to say: 1995: Something notable happened 2001: Something else of note happened I found something similar on http://www.freesticky.com, but it isn't really
4
14158
by: Otis Hunter | last post by:
I have been fighting with this for days and your expert help is needed! Below is the code I am executing which results with "Object doesn't support this property or method". The error is occuring on the "With Me.OLEObject" line (By the way, I haven't found documentation which explains what the "With" clause is suppose to do?). I am trying to extract a Word document(OLE object) from an Access database, for each record in the table, and...
1
16455
by: Dr. J | last post by:
I have an application that opens a socket and connects to another application listening over a port. The problem I am encountering is that when the listening application is closed my application cannot detect it to take appropriate action. I am using "Connected" property of the Socket class, but it seems this property does not reflect the true state of the socket connection. Here is the code snippet. Basically, I am checking the...
4
4651
by: ajschuster | last post by:
I cannot get my Javascript to work in Firefox. I am just trying to access the .name property of a DIV tag but it keeps coming back as "undefined". The same code works in IE and it works in Safari.... and if I change it to .id instead of .name it can read that so why wouldn't it be able to read the .name? I need urgent help!! Here's my code....
3
2266
by: jbeteta | last post by:
Hello, I have a problem declaring variables. I need to create an object oRpte as ReportClass on WebForm1.aspx and be able to use its value on WebForm2.aspx. For declaring the property oRpte() on WebForm1.aspx, I use "Public Property" and I declare variable _oRpte as Friend Shared. That's my problem. If I don't declare _oRpte as Friend Shared, I can't use WebForm1.oRpte() on other webpage. If I declare _oRpte as Friend Shared, I can use...
15
12545
by: simonoficina | last post by:
Hello all! I am a vb.net beginner in Spain. When I use VB6 ,the button object has a property called "default" that can set this button like press "ENTER" key. But in the VB.net I can't find this property. Where is it? Or mabye change the other thing,No?Thanks ! Simon
3
2845
by: Bob Cohen \(106531\) | last post by:
I want to define some metadata using custom attributes to apply to properties in various classes. The properties return values that are classes themselves. I want to retrieve the attribute information in the classes from which the fields/properties are derived, but I can't figure out how to get them. I seem to be stuck since the attributes are declared against the property, but the information is returned from the base class; I don't...
11
7697
by: hamiltongreg | last post by:
I am new to Java and am having problems getting my program to compile correctly. My assignment is as follows; Choose a product that lends itself to an inventory (for example, products at your workplace, office supplies, music CDs, DVD movies, or software). • Create a product class that holds the item number, the name of the product, the number of units in stock, and the price of each unit. • Create a Java application that displays the...
0
8996
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
9562
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
9386
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8255
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...
1
6799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6078
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();...
1
3319
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
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.