Hi Alex,
As it turns out, having properties update inside the designer's PropertyGrid is one thing, and updating it within the designer UI at the same time is another.
For updating the PropertyGrid contents, you can simply add RefreshProperty attribute to your custom property. Using the same sample for the TextBox as I used before, the property declaration can be:
[RefreshProperties(RefreshProperties.Repaint)]
public string SecondaryText
{
get { return _SecondaryText; }
set
{
if (this.Text != value)
this.Text = value;
_SecondaryText = value;
}
}
This would get the Text property updated inside the designer's propertygid.
Updating it within the designer UI area will require that you create a custom controller and then set the DesignTimeController of your class to be your custom controller. The controllers mechanism is all part of our public code, so you should take a look there to see what options you have for customizations. Just remember that the controller's role is a kind of bridging the gap between the WebForm control that is the output of your designer, and the WinForms control used within the designer UI while designing. You will soon see that every controller has a SourceObject (the webcontrol) and a TargetObject (the wincontrol) and it's bridging between those two.
Again, building on the SecondaryText property sample, I created a demo application for you here, that implements a custom controller that, along with the the RefreshProperties attribute setting, make sure that when you update the new custom SecondaryText property within the propertygrid, it will update the Text property within the propertygrid (because of the attirbute setting) and then update the Text within the TextBox on your form inside the design UI, fully updating all the "triggered" updates both in propertygrid and designer.
Hope this helps,
Palli