By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,883 Members | 1,125 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,883 IT Pros & Developers. It's quick & easy.

How to get a PropertyGrid's cell value

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.