473,513 Members | 2,490 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 5655
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.Properties.Add("LastName", typeof(string), "Lefebvre");
PropertyGrid1.Properties.Add("FirstName", typeof(string), "Yanick");
PropertyGrid1.Properties.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********@home.ro> wrote in message
news:%2*****************@TK2MSFTNGP09.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.ComponentModel.ICustomTypeDescriptor 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_lefebvre at hotmail dot com> wrote in message
news:%2****************@TK2MSFTNGP12.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.ComponentModel.ICustomTypeDescriptor class.
That should be ICustomTypeDescriptor interface, not class.

Jay

"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message
news:%2***************@TK2MSFTNGP12.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.ComponentModel.ICustomTypeDescriptor 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_lefebvre at hotmail dot com> wrote in message
news:%2****************@TK2MSFTNGP12.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
2883
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...
3
6037
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...
1
11855
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...
1
2555
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...
7
9700
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
3064
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...
6
6921
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
15303
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,...
4
18805
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...
3
4325
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,...
0
7260
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,...
0
7160
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
7384
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,...
1
7099
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...
0
7525
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...
0
5685
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,...
0
4746
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
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
799
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.