This is a migrated thread and some comments may be shown as answers.

Composite Control and Intellisense support for enum Property

0 Answers 69 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Pascal
Top achievements
Rank 1
Pascal asked on 14 Apr 2011, 07:37 AM
Hello,

I'm facing the following problem. I'm trying to build a Composite Control that uses Telerik control as child control, I try to create a new Property for this control that can only be Val1, Val2 or Val3.

I've created a enum to list all property values:
public enum MyEnum{Val1,Val2,Val3}

Then I've created a Property in my composite control whose type is MyEnum like this:
public MyEnum? MyControlAttribute
{
    get { return (MyEnum?)ViewState["MyControlAttribute"]; }
    set { ViewState["MyControlAttribute"] = value; }
}

When I build my library and try to use the composite control, Intellisense don't work as needed. I would like to have Intellisense propose Val1, Val2 or Val3 for the attribute. Is that possible?
<ns:MyCompositeControl ID="ccid" runat="server" MyControlAttribute="...." />
I suppose I missed an attribute on the Property MyControlAttribute, but I don't know which one.

Any help would be appreciated.

Thanks.

Pascal

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
Pascal
Top achievements
Rank 1
Share this question
or