Groups | Blog | Home
all groups > asp.net building controls > october 2005 >

asp.net building controls : Allowing a new design property for control inheriting DataGrid


Joey Lee
10/13/2005 12:00:00 AM
Hi,

I created a custom control inheriting from DataGrid

I would like to put a custom property for design time manipulation

I added the accessor as below code but is does not appear in the property
window. However other custom control i created having this code has no
problem at all. Please help

Thanks

Joey

======================================================
[Bindable(true),
Category("CustomSettings"),
DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
protected string MyNewProp
{
set
{
myNewProp= value;
}
get
{
return myNewProp;
}
}

Ken Dopierala Jr.
10/13/2005 12:37:18 PM
Hi Joey,

I use VB.Net to create my controls. Here is how I add a property to a
textbox:

<PersistenceMode(PersistenceMode.Attribute), Category("CSS"),
Bindable(True)> _
Public Property ActiveCSS() As String
Get
Return mstrActiveCSS
End Get
Set(ByVal Value As String)
mstrActiveCSS = Value
End Set
End Property

The only big difference is I use Public and you use protected. Maybe
changing it to public will work for you. Just a guess though because I
don't use C#. Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

[quoted text, click to view]

Joey Lee
10/14/2005 9:38:56 AM
Thanks. changing it to public works.

[quoted text, click to view]

AddThis Social Bookmark Button