473,326 Members | 2,192 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,326 software developers and data experts.

Change Read/Write Property on Property Grid

Hi

Is there any way to enable/disable an item in a property grid at runtime?

I have two properties that I am showin in a property gris and based on the
validity of the first property, I want to disable/enable the second
property. Therefore the user would not be able to set or change the value
of the second property should a tes on the first property fail.

Regards, Carl Gilbert
Nov 21 '05 #1
1 6925
Hi Carl,
Is there any way to enable/disable an item in a property grid at runtime?


From my understanding, I think you want to change the ReadOnly attribute of
the item in a PropertyGrid at runtime, is it?

If so, you are going to use custom PropertyDescriptor class for those
properties, and that class should implement the
"ICustomTypeDescriptor" interface for the usage of the properties of a
PropertyGrid, you can refer to the following group links for the detail
discussion and sample code:
http://groups-beta.google.com/group/...amework.window
sforms/browse_thread/thread/1f88a0b456c11af3/439a06cf4ca0aff2?q=propertygrid
+disable+item&_done=%2Fgroups%3Fq%3Dpropertygrid+d isable+item%26hl%3Den%26lr
%3D%26sa%3DN%26tab%3Dwg%26&_doneTitle=Back+to+Sear ch&&d#439a06cf4ca0aff2

By the way, another method is enumerating the item you want to disabled,
and clone a new property item(ReadOnly: ture) with it, then remove the old
one and add the new one at run time, you can find many samples how to add
(remove) Items of a PropertyGrid at runtime in the web...
Thanks!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default...sdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #2

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

Similar topics

1
by: windandwaves | last post by:
Hi Folk I am working with the TYPE property. I want to change that from 2 (byte) to 4 (long integer) for a field that already contains tons of data. How can I do that? The help reads: ...
1
by: travis powell | last post by:
i have created a string class. later on i created a procedure where i need to change charaters in the string. it seems to work just fine unitl i want to assigm the new character values to a...
12
by: Jens Thiel | last post by:
Hi, is there a reason for C# to require attribute arguments (properties) to be read-write while VB and C++ are happy with only a setter? Simplified Example: public sealed class FooAttribute...
7
by: Shimon Sim | last post by:
I have a custom composite control I have following property
1
by: David Fúnez | last post by:
Hi; I'm working with Component One FlexGrid DataGrid, i've added a calculated field to the DataGrid, when i press the Save Button an error message is displayed "Cannot Change read Only...
1
by: darin_dimitrov | last post by:
Is it possible to determine if a property is read-only, write-only or read-write with reflection? Does MemberInfo class contains such information? Thanks
0
by: jwtulp | last post by:
Hello, I have a question about XmlSerialization. I have a class with a private field called createDate of the type DateTime. In the constructor of my class I use DateTime. Now to create a...
2
by: Saran | last post by:
Hi, Below is my scenario... I want to restrict my clients to access one of my class property in ReadOnly mode. At the same time as an author of the component i would like to have read-write...
3
by: Maurizio | last post by:
I create an application with Access 2000 and I wish to read/write the properties of a specified word document. I use dsofile.dll my code is Function fGetDocProps(strInFile As String, strProp As...
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.