473,320 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

PropertyGrid - Browsable property yet readonly?

Tom
I'm using the PropertyGrid, and have it bound to a class object. Works
fine - however, I have some properties that I want to show up on the grid
(i.e. they are browsable) -YET- I don't want the user to be able to change
them; i.e. want them ReadOnly to the grid. I tried setting that classes
property to the ReadOnly attrib, but it wouldn't take it. (Keywork is not
valid as an identifier)

So how can one have a property value that shows up on the property grid YET
is ReadOnly? I'm sure it has got to be some attribute but can't figure out
what it is.

Thanks.

Tom
Nov 21 '05 #1
3 4722
Tom
Never mind, figured it out. Turns out you can't put the attribute
READONLY(TRUE) on the property, BUT you can put READONLYATTRIBUTE(TRUE) on
the property and it works!?! I am not sure what the difference is between
the two... but the second one does work.

Tom
"Tom" <to*@nospam.com> wrote in message
news:u3**************@TK2MSFTNGP14.phx.gbl...
I'm using the PropertyGrid, and have it bound to a class object. Works
fine - however, I have some properties that I want to show up on the grid
(i.e. they are browsable) -YET- I don't want the user to be able to change
them; i.e. want them ReadOnly to the grid. I tried setting that classes
property to the ReadOnly attrib, but it wouldn't take it. (Keywork is not
valid as an identifier)

So how can one have a property value that shows up on the property grid YET is ReadOnly? I'm sure it has got to be some attribute but can't figure out
what it is.

Thanks.

Tom

Nov 21 '05 #2
On Thu, 7 Oct 2004 08:06:18 -0400, Tom wrote:
Never mind, figured it out. Turns out you can't put the attribute
READONLY(TRUE) on the property, BUT you can put READONLYATTRIBUTE(TRUE) on
the property and it works!?! I am not sure what the difference is between
the two... but the second one does work.


Since ReadOnly is a VB keyword, you would have to place it in square
brackets:

<[Readonly](True)>
--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
Nov 21 '05 #3
Tom
Chris: Crap, I should have thought of that myself ;-)

That explains it. Thanks.

Tom

"Chris Dunaway" <"dunawayc[[at]_lunchmeat_sbcglobal[dot]]net"> wrote in
message news:1a*****************************@40tude.net...
On Thu, 7 Oct 2004 08:06:18 -0400, Tom wrote:
Never mind, figured it out. Turns out you can't put the attribute
READONLY(TRUE) on the property, BUT you can put READONLYATTRIBUTE(TRUE) on the property and it works!?! I am not sure what the difference is between the two... but the second one does work.


Since ReadOnly is a VB keyword, you would have to place it in square
brackets:

<[Readonly](True)>
--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.

Nov 21 '05 #4

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

Similar topics

0
by: micro_bug | last post by:
Now I am developing a tool, just like VS.net Form Edition environment. User can edit a component's properties by a PropertyGrid control. Now I have some questions about this PropertyGrid control:...
1
by: S.mark | last post by:
Hi, I can't find the ReadOnly property in PropertyGrid control (Visual Studio 2005), is there any work around to display object properties with the new PropertyGrid control in ReadOnly mode ? ...
1
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...
2
by: Lance | last post by:
I want to be able to reset a complex property in a PropertyGrid. I know that for properties that are ValueTypes you can include System.ComponentModel.DefaultValue in the declaration of the property....
2
by: =?Utf-8?B?TWF1cmljZU0=?= | last post by:
Hi all, how can I hide a property in a derived class in a propertygrid. Let's say I have a classX and a derived classY. A property in classX will be visible in the propertygrid but the same...
2
by: =?Utf-8?B?Sm9obiBPbGJlcnQ=?= | last post by:
Is there a way to pass a class to the SelectedObject of PropertyGrid and have it only show the properties in the child class and not those in the base class's that it is derived from? Thanks. ...
4
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
I have assigned an existing object to propertygrid.selectedobject property. But I only want some of the object's properties not browsable and/or readonly. How can I do that? I'm trying to find...
3
by: michelqa | last post by:
Hi, I have a form with a control..(a button for example). Then the control properties are displayed in a propertyGrid control. Is there any simple way to remove some unwanted properties from...
0
by: ntabb | last post by:
Hello all, I have a class instance that I'm attaching to a propertygrid. I would like to find a way to change the "Browsable" attribute during runtime or programmatically from outside the class...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.