Allowing a new design property for control inheriting DataGrid

J

Joey Lee

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;
}
}
 
K

Ken Dopierala Jr.

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.
 
J

Joey Lee

Thanks. changing it to public works.

Ken Dopierala Jr. said:
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.

Joey Lee said:
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;
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top