473,503 Members | 11,018 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to get a PropertyGrid's cell value

Using a propertyGrid to allow input of parameter values. I need to get both
each property name and property value for each property name/value pair show
in the property grid. I can get the property name thus, but how do I get
the associated value string?
Dim pdc As PropertyDescriptorCollection =
TypeDescriptor.GetProperties(PropertyGrid1.Selecte dObject, True)

Dim pd As PropertyDescriptor

For Each pd In pdc

strPropertyName = pd.Name

strPropertyValue = ???

Next

Thanks,

Dean Slindee
Nov 21 '05 #1
2 6753
Dean,
but how do I get
the associated value string? Have you tried PropertyDescriptor.GetValue?
For Each pd As PropertyDescriptor In pdc
strPropertyName = pd.Name
strPropertyValue = pd.GetValue(PropertyGrid1.SelectedObject)
Next
Hope this helps
Jay

"Dean Slindee" <sl*****@charter.net> wrote in message
news:10*************@corp.supernews.com... Using a propertyGrid to allow input of parameter values. I need to get
both
each property name and property value for each property name/value pair
show
in the property grid. I can get the property name thus, but how do I get
the associated value string?
Dim pdc As PropertyDescriptorCollection =
TypeDescriptor.GetProperties(PropertyGrid1.Selecte dObject, True)

Dim pd As PropertyDescriptor

For Each pd In pdc

strPropertyName = pd.Name

strPropertyValue = ???

Next

Thanks,

Dean Slindee

Nov 21 '05 #2
That's what I needed. Thanks Jay
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:O#*************@TK2MSFTNGP11.phx.gbl...
Dean,
but how do I get
the associated value string?

Have you tried PropertyDescriptor.GetValue?
For Each pd As PropertyDescriptor In pdc
strPropertyName = pd.Name


strPropertyValue = pd.GetValue(PropertyGrid1.SelectedObject)
Next


Hope this helps
Jay

"Dean Slindee" <sl*****@charter.net> wrote in message
news:10*************@corp.supernews.com...
Using a propertyGrid to allow input of parameter values. I need to get
both
each property name and property value for each property name/value pair
show
in the property grid. I can get the property name thus, but how do I get the associated value string?
Dim pdc As PropertyDescriptorCollection =
TypeDescriptor.GetProperties(PropertyGrid1.Selecte dObject, True)

Dim pd As PropertyDescriptor

For Each pd In pdc

strPropertyName = pd.Name

strPropertyValue = ???

Next

Thanks,

Dean Slindee


Nov 21 '05 #3

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

Similar topics

0
1289
by: Robert Hooker | last post by:
I know that this question has been batted around here for a while - and I know that sample code, using reflection and poking around inside the propertygrid class, has been posted by a kind soul.......
0
2148
by: Jay Shakankar via .NET 247 | last post by:
Dear Friends, I have been assigned to develop a Custom PropertyGrid with lookand fill like the link below. http://www.visualhint.com/feature5.php In the PropertyGrid value cells, I am assigned...
0
6321
by: jays | last post by:
Dear Friends, I have been assigned to develop a Custom PropertyGrid with look and fill like the link below http://www.visualhint.com/feature5.php In the PropertyGrid value cells, I am...
5
15302
by: Sharon | last post by:
I'm using the PropertyGrid control, and I want it to show a button. But I set the PropertyGrid.SelectedObject with a object that as a Button property, the PropertyGrid shows the buttons properties,...
2
1611
by: Sparky74 | last post by:
Hi, does anyone know how to take control of the PropertyGrid so that you can highlight an entire cell? Specifically, what I would like to do is paint the background of a property label a different...
0
1199
by: Sparky74 | last post by:
I have a number of Int32 properties that I want to display in a PropertyGrid control. The problem I have is that I want to be able to bypass the framework's default validation. If you have an Int32...
2
2737
by: HenrikRinder | last post by:
This is a silly question, but now I have spent hours trying to figure it out. Thus, asking this forum: Our application GUI has a .NET PropertyGrid. Our customers don't find it intuitive to...
8
4798
by: colin | last post by:
Hi, I thought I could use the property grid to nicly edit some of my data, however it seems to require each field to be a property, wich I didnt realise was implied in the name of it lol. Is...
2
5023
by: matthijsdezwart | last post by:
Hi, I was wondering if someone can help me out with a propertygrid problem. Someone else made a program where I insert my script. This script has some propertíes, which are specified like: ...
0
7095
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...
0
7361
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...
1
7015
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5026
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...
0
4693
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...
0
3183
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...
0
3173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
749
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
403
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...

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.