Adding designer smart tags to custom web controls

by Juan 15. May 2008 12:22
Share on Facebook

This week I've been designing a few custom web controls for a development framework here in Iceberg, and I added smart tags to them… it's very easy to do, and it gives them a very professional look.

The first step is to decorate your control class with the Designer attribute, and pass the type of the class that will handle the smart tags, like so

That's all the modification to the control class itself.

Then you have to provide the designer class, which unless you have specific needs, would look like this:

The final step is to provide the action list itself. All you have to do is provide a constructor to receive the component and call the base constructor with it, and override the GetSortedActionItems method and provide the list, like so

Also you have to provide a property in this class to receive the value entered by the developer and set it to the control, it has to match the first parameter of the DesignerActionPropertyItem constructor.

And depending how you designed your control, you'd get something like this

You can find source code in the article I used as a starting point

Tags: , , , ,

Programming

Powered by BlogEngine.NET 1.4.5.15
Theme by Mads Kristensen Modified by Juan Manuel Formoso

About the Author

Juan Manuel
Networking
View my LinkedIn profile View my Facebook profile View my Twitter feed View my StackOverflow CV

Juan Manuel Formoso
There is a theory which states that if ever anyone discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something more bizarrely inexplicable.

There is another theory which states that this has already happened.

E-mail me Send mail

Hosting is not Free

Google Reader Picks

Most comments

Cristian Cristian
1 comments
co Colombia

Calendar

<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

Recent comments

Comment RSS

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in  anyway.

© Copyright 2008