473,796 Members | 2,488 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Property List

I want to write a routine which will list all of the propetries and all
property names for a particular object, say a DataColumn. I there a way
for me to do this without manually looking up each property name and the
property value?
Thanks in advance for your assistance!!!!! !!!!!!
Nov 15 '05 #1
2 5239
Hi Jim,

You might take a look at reflection.
Type.GetPropert ies method is what you need.

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rhand.com

"Jim Heavey" <Ji*******@nosp am.com> wrote in message
news:Xn******** *************** **********@207. 46.248.16...
I want to write a routine which will list all of the propetries and all
property names for a particular object, say a DataColumn. I there a way
for me to do this without manually looking up each property name and the
property value?
Thanks in advance for your assistance!!!!! !!!!!!

Nov 15 '05 #2
I suggest you take a look at the PropertyGrid control:
http://msdn.microsoft.com/library/de...ngpropgrid.asp
If you have used Microsoft® Visual Basic® or Microsoft Visual Studio .NET
then you have used a property browser to browse, view, and edit the
properties of one or more objects. The .NET Framework PropertyGrid control
is core to the property browser that is in Visual Studio .NET. The
PropertyGrid control displays properties for any object or type, and it
retrieves the item's properties, primarily using reflection. (Reflection is
a technology that provides type information at run time.)

Otherwise, if you want to do it all manually, you can use refelection:
object o;

foreach(System. Reflection.Prop ertyInfo pi in o.GetType().Get Properties())
{
MessageBox.Show (pi.Name);
}
object o;

foreach(System. Reflection.Prop ertyInfo pi in o.GetType().Get Properties())
{
MessageBox.Show (pi.Name);
}
--
Greetz,
Jan
_______________ _______________ ____
Read my weblog: http://weblogs.asp.net/jan
"Jim Heavey" <Ji*******@nosp am.com> schreef in bericht
news:Xn******** *************** **********@207. 46.248.16...
I want to write a routine which will list all of the propetries and all
property names for a particular object, say a DataColumn. I there a way
for me to do this without manually looking up each property name and the
property value?
Thanks in advance for your assistance!!!!! !!!!!!

Nov 15 '05 #3

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

Similar topics

8
2844
by: Vipin Kedia | last post by:
Hi I have written a code for showing the list boxes as selected using a Listitem and the selected property of the items. Now I have 2 list boxes in my page. But it shows only the selected values of the last list box in both the list boxes. If i reverse the calls to the filllistbox methods it shows the value selected for the 1st list box in both the listboxes. I have the code for my method below. Is there a way I can solve this problem?
1
2795
by: Georg Scholz | last post by:
Hello, The class "Control" contains a documented Property "ControlType". So for example, in a form, you can write code like this: Dim c as control set c = me.Controls("textbox1") if c.ControlType = acTextBox then ...
0
1454
by: Jordan Bowness | last post by:
I make a similar post in another newsgroup, but this example is simplified somewhat. I have a component (cmpMyComponent) with 2 properties. The 1st property is a string value (Description) and the 2nd property is a strongly typed collection class (myCollectionProperty). The collection contains a simple class (myCustomClass) which has 1 text property (TextProperty).
6
1874
by: Altman | last post by:
I would like to use an indexed property to access my private array of user controls. If I don't use an indexed property, the property will show up in my Properties Window during development. Is there a way to get this to show up in the properties window?
9
7910
by: Paul | last post by:
Hi, I feel I'm going around circles on this one and would appreciate some other points of view. From a design / encapsulation point of view, what's the best practise for returning a private List<as a property. Consider the example below, the class "ListTest" contains a private "List<>" called "strings" - it also provides a public method to add to that list,
1
1134
by: shapper | last post by:
Hello, I created a user control (.ascx) with a property as follows: Private _Messages As Generic.List(Of String) Public Property Messages() As Generic.List(Of String) Get Return _Messages End Get Set(ByVal value As Generic.List(Of String))
1
1348
by: shapper | last post by:
Hello, I have a class where I created various controls. One of the controls have a property which is a generic list of WebControl. Then in web site page I have something like: Dim a As New MyNamespace.ListItem a.WebControls.Add(tbName) a.WebControls.Add(lLabel)
1
1607
by: shapper | last post by:
Hello, I am creating a control which I will compile in a class. I am having problems when I use a property in the View State: ' Items <Bindable(True), Category("Data"), DefaultValue(""), Localizable(True)_ Property Items() As Generic.List(Of String) Get
3
993
by: shapper | last post by:
Hello, Is there a difference between defining a control property in the following two ways: ' Items ... Private _Items As Generic.List(Of ListItem) = New Generic.List(Of ListItem) **** Property Items() As Generic.List(Of ListItem) Get
1
1362
by: dwillis | last post by:
ok will try again on this forum to bee clear i'm using vb.net 2005. so on to the problem i've search the net extensivly and can not find a clear example on how to acomplish what i'm trying to do. So here it is, i'm using the property grid to display alot of properties derived from an INI file. everything works fine but now i'm trying to tweek one part of it. First off let me tell you that i have a lot of com port on this pc(16), the INI file...
0
9529
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
10457
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
10013
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
9054
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
7550
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
6792
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
5576
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3733
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2927
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.