all groups > dotnet windows forms designtime > january 2005 >
You're in the

dotnet windows forms designtime

group:

Update Propertygrid with Verbs



Update Propertygrid with Verbs Avi Dubnikov via DotNetMonster.com
1/17/2005 7:48:33 PM
dotnet windows forms designtime: I'm updating a simmpe property of my control, using verbs. The value on the property grid is updated as requested. Yet, there's no update to the form's code. How do I force the system to generate the code?

--
Re: Update Propertygrid with Verbs joeycalisay
1/18/2005 3:02:11 PM
You should do a broadcasted change for affected properties:

PropertyDescriptor prop =
TypeDescriptor.GetProperties(component)[propertyName];
prop.SetValue(component , value);

--
Joey Calisay
http://spaces.msn.com/members/joeycalisay/


"Avi Dubnikov via DotNetMonster.com" <forum@DotNetMonster.com> wrote in
message news:551941eab17643c7af79e7b318087bff@DotNetMonster.com...
[quoted text, click to view]
the property grid is updated as requested. Yet, there's no update to the
form's code. How do I force the system to generate the code?
[quoted text, click to view]

Re: Update Propertygrid with Verbs AviD
1/18/2005 3:37:01 PM
Hi,
Thanks for the reply. I’ve already tried your suggestion but this will not
serialize the code. It will update the descriptor as much as just moving the
new value to the property in code does. BTW, I’m using the code the event
handler of the verb in the control’s designer class. It seems to me that I
will have to create a TypeConverter just for the property, and work the code
in the ConverTo method.
Avi


[quoted text, click to view]
Re: Update Propertygrid with Verbs AviD
1/18/2005 7:55:02 PM
Happy to say that I've solved the problem. The control designer has a method
called
"RaiseComponentChanged" which will persist the change in code.


[quoted text, click to view]
AddThis Social Bookmark Button