473,657 Members | 2,428 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 PropertyDescrip torCollection =
TypeDescriptor. GetProperties(P ropertyGrid1.Se lectedObject, True)

Dim pd As PropertyDescrip tor

For Each pd In pdc

strPropertyName = pd.Name

strPropertyValu e = ???

Next

Thanks,

Dean Slindee
Nov 21 '05 #1
2 6771
Dean,
but how do I get
the associated value string? Have you tried PropertyDescrip tor.GetValue?
For Each pd As PropertyDescrip tor In pdc
strPropertyName = pd.Name
strPropertyValu e = pd.GetValue(Pro pertyGrid1.Sele ctedObject)
Next
Hope this helps
Jay

"Dean Slindee" <sl*****@charte r.net> wrote in message
news:10******** *****@corp.supe rnews.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 PropertyDescrip torCollection =
TypeDescriptor. GetProperties(P ropertyGrid1.Se lectedObject, True)

Dim pd As PropertyDescrip tor

For Each pd In pdc

strPropertyName = pd.Name

strPropertyValu e = ???

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#******** *****@TK2MSFTNG P11.phx.gbl...
Dean,
but how do I get
the associated value string?

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


strPropertyValu e = pd.GetValue(Pro pertyGrid1.Sele ctedObject)
Next


Hope this helps
Jay

"Dean Slindee" <sl*****@charte r.net> wrote in message
news:10******** *****@corp.supe rnews.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 PropertyDescrip torCollection =
TypeDescriptor. GetProperties(P ropertyGrid1.Se lectedObject, True)

Dim pd As PropertyDescrip tor

For Each pd In pdc

strPropertyName = pd.Name

strPropertyValu e = ???

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
1300
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.... but I'm really hoping that someone on the Forms team, or C# team at Microsoft can have a go at answering this. Q: When inside a property grid, I am throwing exceptions when a value is out of range for a cell. All works well - I get the...
0
2155
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 to display thecontrols like NumericUpDown, RadioButtons, CheckBox, ListBoxetc.I read several articles both in CP and MSDN and gathered thefollowing informations. I request the CPians to comment on thebelow points(point 1 to point 3) 1.It is not...
0
6328
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 assigned to display the controls like NumericUpDown, RadioButtons, CheckBox, ListBox etc I read several articles and gathered the following informations I request you to comment on the below points(point 1 to point 3)
5
15331
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, and I want the button to be shown as drawn and clickable button. How can I do that? -- Thanks Sharon
2
1618
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 colour when validation fails. I have experimented a little with the UITypeEditor and I've found that I can paint within the cell of the value that is being modified but I'd like to be able to change the background of the entire row when the entire...
0
1207
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 property, delete the text within the propertygrid cell, then the default validation error window appears. I want to modify the value to zero if no value is entered. I notice that the ConvertTo/ConvertFrom methods return objects.. which Int32...
2
2752
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 navigate it using the keyboard (and I agree). The default behaviour of the PropertyGrid (PG) is that when a row is selected, the property name is highlighted, but the value column/cell is not. Still, it is perfectly OK to enter values into the "value...
8
4809
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 there a way to customize it so it can display and edit fields wich are stored in a dictionary ? the classes I have is basically a custom/user defined class,
2
5031
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: public string _firstProp; public int _secondProp;
0
8842
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
8740
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...
1
8516
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8617
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
7353
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
6176
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
5642
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
2743
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
1733
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.