Bora
5/26/2007 2:09:00 AM
Hi Miguel,
Just a guess, in propertygrid events are displayed seperately from
properties (the lightning icon in propertygrid's toolbar). You might be
missing looking there. If not, would be nice if you send the code you wrote
for the event.
In a simple explanation, DevaultValue is used by Visual Studio if to write
value to aspx page or not. values different than DefaultValue will be
written to aspx page (which are bold in propertygrid). You should set
default value by yourself (like below for example.)
private string myPropertyDefault = "default";
public string MyProperty
{
get
{
object o = ViewState["MyProperty"];
return o==null ? defaultMyProperty : o as string;
}
set
{
ViewState["MyProperty"] = value;
}
}
Bora
"Miguel" <nospam@nospam.com> wrote in message
news:O$zO$pwnHHA.4220@TK2MSFTNGP04.phx.gbl...
> Hi
> I have builded some user controls in asp.net and works fine. These contros
> have public properties, that I can view and modify at design time in the
> properties panel. Both, properties and events, have the
> [System.ComponentModel.Browsable(true)] attribute.
> But, the events don't appear in de properties panel.
>
> Also the [System.ComponentModel.DefaultValue("MyValue")] attribute for the
> properties have not effect and I must assign these values at runtime
>
> Any Idea?
>
> best regards
> Miguel
>