
property throws Exception in visual designer!
Cody,
Place the Browsable attribute on your property, passing in false to the
constructor, like so:
[Browsable(false)]
public string SelectedValueDBKey
{
get
{
if (Text=="")
return "null";
return dbConn.gettext("select "+idCol+" from "+table+" where
"+textCol+"='"+Text+"'");
Quote:
}
set
{
if (value==null)
Text="";
else
Text = dbConn.gettext("select "+textCol+" from "+table+" where
"+idCol+"='"+value+"'");
Quote:
}
}
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
Quote:
> hi i have a problem concerning custom properties. i have following
property
> and the problem is when i open the designer an exception occures because
the
> values aren't known at designtime. how can i avoid this?
> is there a way to hide the property from the designer? or should i make it
> to a method?
> public string SelectedValueDBKey
> {
> get
> {
> if (Text=="")
> return "null";
> return dbConn.gettext("select "+idCol+" from "+table+" where
> "+textCol+"='"+Text+"'");
> }
> set
> {
> if (value==null)
> Text="";
> else
> Text = dbConn.gettext("select "+textCol+" from "+table+" where
> "+idCol+"='"+value+"'");
> }
> }