473,801 Members | 2,324 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

querying all Properties and its values Property window or Propertygrid in c#

2 New Member
Hi
i needed help me to retrieve properties of a control, i got a
scenario to read all available properties and its current assigned
values for different controls in project. i tried with reflector tool
but it giving properties of classes. I am not sure how to get property
and its value. right now i have open property window for each control
(Properties window) and noting down from a-z properties and its values.
could you help me to get programmaticall y all properties and its value?
after reading posts in this site i tried like this :

Retrieving for Button control:

private void Button1_Click(o bject sender, System.EventArg s e)
{
Display(this.Bu tton1);
}

private void Display(object o)
{
PropertyDescrip torCollection pdc = TypeDescriptor. GetProperties(o );

foreach (PropertyDescri ptor pd in pdc)
{
while(true)
{ PropertyDescrip torCollection childCollection s=pd.GetChildPr operties();

if(childCollect ions.Count>0)
{
PropertyDescrip torCollection px = TypeDescriptor. GetProperties(p d);

}
else
{
Response.Output .WriteLine("\t\ t<b>Child:&nbsp ;</b>"+ pd.DisplayName + "<br>") ;
}
}
}

i want to recursively get all subchild properties for each properties and also if any subchildpropert ies exist for each subchild i want to drill it down and get values. In another way if i send datagrid as object to this method it must have to get all properties. help me i am trying from so many days ........
Nov 22 '06 #1
0 1319

Sign in to post your reply or Sign up for a free account.

Similar topics

3
5079
by: Martin Montgomery | last post by:
I have, for example, a property called myProperty. I would like, when using a property grid to display the property name as "My Property". Is this possible. Is there an attribute etc Thank Martin
2
1953
by: poifull | last post by:
In the "Properties Window" in the Visual Studio Environment. When you click on Categorized View, properties are grouped by property types with an collapsible icon next to the type name. That would be a nice feature for my application. Is the Property Window something I have to develop or if it is available somewhere? If I have to build it what control should I use? Thanks for reading this message
2
1266
by: Patrick | last post by:
I remeber seeing a sample on th e.net (and in fact i tried this too - but lost the source code), to achieve the following. Dropping a control onto a form, which is exactly like the properties window, and can be used to set the properties of a control, esp command buttom. Anyone out there know how this is done, I just can't remeber and its eating me. tks
0
1536
by: movieknight | last post by:
Hi, I have a class which I am feeding to the propertygrid, and I am exposing a Mesh object from my class for the propertygrid to display. I want the propertygrid to show the values (when you expand the property) and allow those values to be edited. My code is below. The grid is showing the values but they are read-only, although the other properties for the rest of my class are editable. Public Class MeshConverter
17
1531
by: Bruce One | last post by:
Lets consider a class called Currency. This class must be the responsible for taking care of all calculations over currency exchanges, in such a way that I pass values in Euros and it returns the converted value in Dollar for example... Well, I might do this in 2 ways, as below: 1) I create a method like this: double ConvertValue (double OriginalValue) { // here I compute the value
4
3306
by: Tugrul HELVACI | last post by:
Changing DisplayNames of my properties using PropertyGrid component, how ?? I'm using Delphi 2006 and I have a class defination like this: TPerson = class fPersonName : String; fPersonSurName : String; fPersonAge : Integer; published property PersonName : String read fPersonName write fPersonName;
3
1770
by: jarnie | last post by:
I am attempting to make a form which has alpha transparency that varies across the form, similar to the Adobe splash screens and launchy: http://www.launchy.net/images/screenshot_sheep.jpg After a few different approaches, I have ended up overriding the OnPaint method and using Graphics.CopyFromScreen and then painting the transparent PNG on top of this using DrawImage. I have so far been able to get the same effect when stationary, but...
0
1211
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...
5
2576
by: Jon Pope | last post by:
I've got a class which contains properties. I can supply this class to the Properties control, and it will properly display the properties and allow the user to edit them, etc. I would like to be able to programmatically control at runtime which properties are displayed. I've looked at the System.Windows.Forms.Design.ControlDesigner, and specifically looked at the PreFilterProperties() override, but that seems to only work for...
0
9556
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
10292
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
10262
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
10052
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...
1
7589
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
5479
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5616
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2959
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.