By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,567 Members | 1,742 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,567 IT Pros & Developers. It's quick & easy.

how to allow edit property in PropertyGrid with only Set method

P: n/a
Hi!
Within my class (say class A) I have read-only property returning reference
to object of type B (since I do not want other to assign another reference
to this property).
I have created a TypeConverter for class B and I want to allow users to
edit properties exposed by object B. And with subproperties its works fine,
but property within object A is still "grayed", so User cannot write string
value in this field. My GetCreateInstanceSupported() returs false, since I
do not want to create any new instance (thats why my B b {get;} has only Get
method), but I still want to allow users to edit properties of this object.
How to accomplish this functionality?

Thanks for any help!

GRTX,

Paul

<code>

public class A

{

B _b = new B();

public B b

{

get {return _b;} // Read Only, but I want users to edit _b properties
within PropertyGrid using TypeConverter

}

}

[TypeConverter(BTypeConverter)]

public class B

{

public int SomeProperty {get;set;}

}

</code>


Nov 16 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.