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 3 4742
Never mind, figured it out. Turns out you can't put the attribute
READONLY(TRUE) on the property, BUT you can put READONLYATTRIBU TE(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******** ******@TK2MSFTN GP14.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
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 READONLYATTRIBU TE(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_lunch meat_[DOT]net
To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
Chris: Crap, I should have thought of that myself ;-)
That explains it. Thanks.
Tom
"Chris Dunaway" <"dunawayc[[at]_lunchmeat_sbcg lobal[dot]]net"> wrote in
message news:1a******** *************** ******@40tude.n et... 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 READONLYATTRIBU TE(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_lunch meat_[DOT]net
To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and replace certain words in my E-Mail address. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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. How to verify a property's validifity?
as you know, In VS.net, when we input a component name that is same with an
existed name in the propertygrid, an error message will pop up: "Invalid
property value".
Now, my question is, how to implement...
|
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 ?
Thank you.
|
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...
|
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. But, for complex property types (e.g., instance types) this does not work because System.ComponentModel.DefaultValue requires a constant value
In order to indicate if a property should be serialized you can include a boolean function named...
|
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 property in the derived classY will
not be visible in the propertygrid.
Does anyone know how to do this ?
| |
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.
--
John Olbert
|
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 information about propertygrid but most of the
information seems to be for VS2003.
|
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 the
propertyGrid....removing the "AccessibleName" properties by example?
Any example about how to play with the PropertyDescriptorCollection to
remove some properties??
|
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 definition. I would like the end result to display certain contents of the class based on the "machinetype" variable's value.
Any suggestions?
public class Equipment
{
|
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,...
|
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...
| |
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...
|
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...
|
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...
|
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();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |