Adding Editor Zones
You can modify Web Part properties at runtime by using a combination of EditorZone
and EditorPart controls. Editable items include the title, size and location.
In keeping with the Web Part design methodology, "zone controls" are containers
for "part controls". In this section you will add an EditorZone control that contains
an AppearanceEditorPart control. This will give your site users the ability to personalize
the appearance of the page's Web Parts.
1. From the ToolBox drag an EditorZone control onto the WebParts.aspx design surface, placing it in the right
column of the layout table. Set its
ID property to "appearanceEditorZone".
2. Drag an AppearanceEditorPart control into the
EditorZone control, as shown below.
3. To switch to the Edit display mode you must add another option to the RadioButtonList
control. Open the RadioButtonList Tasks menu and click
Edit Items. Add a new item called "Edit", and then click OK.
4. Double-click the RadioButtonList control, and to the existing
flow control statement in the SelectedIndexChanged event handler, add
the following, which supports switching to the Edit display mode:
authorsWebPartManager.DisplayMode = WebPartManager.EditDisplayMode
5. In the Solution Explorer select login.aspx
and then press F5 to run the application. Log in as one of the
application's users. Navigate to WebParts.aspx, and then select
Edit. Click the calendar Web Part's menu and notice the new
Edit option, added now that you are in Edit mode.
6. In the Web Part menu click Edit. In the Editor Zone form, for
Title enter "My Calendar". For Chrome Type select
Title and Border, and then click OK.
As you can see, this resulted in a new calendar title and removal of the thin black border around the calendar
(but not around the WebPartZone itself).
This walkthrough has showed you how easy it is to extend your site's personalization features to support customizing
various Web Part properties. Be sure to experiment with the other new EditorPart controls in the ToolBox.