473,767 Members | 2,224 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PropertyGrid

Hi!

Is it possible to use the PropertyGrid control without bind it to a control?
As if it were a standard list?

I would like to add "properties " in it but i never know what it will be. For
now I use a DataGrid with 2 columns in it where the first one as the
ReadOnly property property set to true.. it's quite ugly.

if it's impossible then i'm open to any suggestions. :O)

thanks all and have a nice weekend!

--
Best Regards
Yanick Lefebvre

Please posts answers to the group so all can benefit
Nov 15 '05 #1
4 5702
Zoury wrote:
Hi!

Is it possible to use the PropertyGrid control without bind it to a
control? As if it were a standard list?

I would like to add "properties " in it but i never know what it will
be. For now I use a DataGrid with 2 columns in it where the first one
as the ReadOnly property property set to true.. it's quite ugly.

if it's impossible then i'm open to any suggestions. :O)


Can you please be more speciffic? I did not understand what you are
trying to achieve. What I can say and hope it helps is that, as far as
I know, the DataGrid can be filled only by binding it to a control, but
this approach is very flexible. You can bind it to an Array built at
runtime, etc.
Nov 15 '05 #2
Hi Christina! :O)

Sorry if it wasn't clear.

I would like to use the PropertyGrid control or something similar to it.
For what i've seen so far this control can be bind to an object using the
SelectedObject property. Doing so fills the PropertyGrid with the public
properties and values of the given object.

I was wondering if there is a way I could fill the PropertyGrid without
using the SelectedObject property. I would like to do something like the
following (note the following syntax doesn't exists.. it's just given as an
example) :

//
// let's say the Add method has the following declaration :
// Property Add(string Name, Type Type, object DefaultValue)
//
PropertyGrid1.P roperties.Add(" LastName", typeof(string), "Lefebvre") ;
PropertyGrid1.P roperties.Add(" FirstName", typeof(string), "Yanick");
PropertyGrid1.P roperties.Add(" DOB", typeof(string), new DateTime(1980, 9,
6));

I hope it's clearer now. ;O)

--
Best Regards
Yanick Lefebvre

Please posts answers to the group so all can benefit
"Christina Androne" <ac********@hom e.ro> wrote in message
news:%2******** *********@TK2MS FTNGP09.phx.gbl ...
Zoury wrote:
Hi!

Is it possible to use the PropertyGrid control without bind it to a
control? As if it were a standard list?

I would like to add "properties " in it but i never know what it will
be. For now I use a DataGrid with 2 columns in it where the first one
as the ReadOnly property property set to true.. it's quite ugly.

if it's impossible then i'm open to any suggestions. :O)


Can you please be more speciffic? I did not understand what you are
trying to achieve. What I can say and hope it helps is that, as far as
I know, the DataGrid can be filled only by binding it to a control, but
this approach is very flexible. You can bind it to an Array built at
runtime, etc.

Nov 15 '05 #3
Yanick,
No! You need to bind the PropertyGrid to an object.

You can however define an object that offers 'dynamic' properties that the
PropertyGrid can then display. See the
System.Componen tModel.ICustomT ypeDescriptor class.

For details on the property grid see:

http://msdn.microsoft.com/library/de...ngpropgrid.asp

http://msdn.microsoft.com/library/de...etpropbrow.asp

Hope this helps
Jay

"Zoury" <yanick_lefebvr e at hotmail dot com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Hi!

Is it possible to use the PropertyGrid control without bind it to a control? As if it were a standard list?

I would like to add "properties " in it but i never know what it will be. For now I use a DataGrid with 2 columns in it where the first one as the
ReadOnly property property set to true.. it's quite ugly.

if it's impossible then i'm open to any suggestions. :O)

thanks all and have a nice weekend!

--
Best Regards
Yanick Lefebvre

Please posts answers to the group so all can benefit

Nov 15 '05 #4
Doh! clicked send just a hair too soon.
See the
System.Componen tModel.ICustomT ypeDescriptor class.
That should be ICustomTypeDesc riptor interface, not class.

Jay

"Jay B. Harlow [MVP - Outlook]" <Ja********@ema il.msn.com> wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. . Yanick,
No! You need to bind the PropertyGrid to an object.

You can however define an object that offers 'dynamic' properties that the
PropertyGrid can then display. See the
System.Componen tModel.ICustomT ypeDescriptor class.

For details on the property grid see:

http://msdn.microsoft.com/library/de...ngpropgrid.asp
http://msdn.microsoft.com/library/de...etpropbrow.asp
Hope this helps
Jay

"Zoury" <yanick_lefebvr e at hotmail dot com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Hi!

Is it possible to use the PropertyGrid control without bind it to a

control?
As if it were a standard list?

I would like to add "properties " in it but i never know what it will be.

For
now I use a DataGrid with 2 columns in it where the first one as the
ReadOnly property property set to true.. it's quite ugly.

if it's impossible then i'm open to any suggestions. :O)

thanks all and have a nice weekend!

--
Best Regards
Yanick Lefebvre

Please posts answers to the group so all can benefit


Nov 15 '05 #5

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

Similar topics

6
2897
by: Terry | last post by:
I have a very basic program, but for some reason I can't get it to behave properly. What I want is a basic form with a TabControl that fills the entire form. The tab control should have 4 tabs with a single PropertyGrid control on each tab that fills it's parent's tab page's client area. Here's what I did. 1. Create a new project.
3
6051
by: Dave Girvitz | last post by:
I have a PropertyGrid (Windows Forms App) based component that uses TypeConverters to generate ranges of acceptable values for properties. The idea was that I could download the key/value pairs from a database and manipulate the TypeConverters dynamically. The property grid then displays the property with a drop down list. It does work when I open the application for the first time. If, however, I open the form and then open a second...
1
11885
by: ANDRES BECERRA | last post by:
Herfried K. Wagner was kind enough to point me to the PropertyGrid control http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemwindowsformspropertygridclasstopic.asp I have found a few samples of how to use the PropertyGrid control and have gained a decent understanding of it. But of course, as it usually the case, my needs go far beyond the simple examples shown in online samples. All the online samples show how to take a class...
1
2578
by: Lance | last post by:
Is there any way to tell a Windows.Forms.PropertyGrid to update the values for the properties that it is displaying? I am having trouble getting the PropertyGrid to update when I make changes to the SelectedObject's properties outside of the PropertyGrid. If I use the PropertyGrid to change the SelectedObject's properties then everything works as expected (even when one property causes another property to change, etc.). But, if I...
7
9730
by: siddhiash | last post by:
Hi Friends I want to add PasswordChar Property which shows ****** for string which I type in PropertyGrid Control. Regards, Siddharth
4
3073
by: Bernie Yaeger | last post by:
How can I set the browsableattributes of the control that has been selected (selectedobject) by the propertygrid? Here's what I'm after - I want to open a form with a propertygrid in it. The selectedobject will be the form itself. I want the user to change certain properties, thus changing the form. This works fine, but what I really want is to take the changes and lock them into a config file, such that this pc will then display all...
6
6935
by: Steve Teeples | last post by:
Can someone show me an example of how to place a "CheckedListBox" property within a PropertyGrid? -- ----------- Thanks, Steve
5
15362
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
4
18822
by: phcmi | last post by:
I have a PropertyGrid question. My task is to replace a legacy dialog box presentation with a modern one. The dialog itself allows the user to set configuration settings in our application, so it seems to me that a PropertyGrid is a perfect modern replacement. I won't bore you with the details with all the controls on the dialog since I'm only concerned with one issue. The legacy dialog contains a drop down list control that is...
3
4355
by: =?Utf-8?B?U3RldmVU?= | last post by:
Is it possible to hide a row within a PropertyGrid based upon the boolean value of another row within the PropertyGrid? I am using VS2005 with .NET Frameworks 2.0. -- ----------- Thanks, Steve
0
9571
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9404
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,...
1
9959
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
6651
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
5279
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
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3929
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
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
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.