For Programmers: Free Programming Magazines  


Home > Archive > C# > January 2005 > struct property and propertygrid









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author struct property and propertygrid
tsteinke@gmail.com

2005-01-07, 3:59 pm

Ok here is the problem. I have a struct property on an object that I
want to edit with the property grid. One of the properties of the
properties of the struct is supposed to be read only to the user.


The inital problem is that when you use the ExpandableObjectConverter
as the type converter the values reset themselfs back to their orginal
values on edit. Most likely because the Propertygrid has a copy of the
value and not the value itself.


So I found by overloading the CreateInstance GetCreateInstanceSupported
Methods of the typeconverter I could get the value in. However now all
my Properties are Writable (even the ones without a "set" implemented)
What is the right way to handle a stuct as a property?

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com