






| Property Name | Type | Description |
|---|---|---|
| ConflictLevel | ConflictLevel | How conflicts are defined. Either when a second user edits the same feature (Row), or only when editing the same attributes of a feature (Column). |
| Conflict Resolution | ConflictResolution | Whether conflicting features are replaced by their representations in the target version or the current edit session. |
| CreateNewFeatureTitle | string | Text title for the section for creating new features. |
| EditableLayers | A list of the layer IDs for all layers that will be editable by the editor | |
| EditAttributesTitle | string | Text title for the section for editing feature attributes. |
| EditExistingFeatureTitle | string | Text title for the section for modifying the geometry and position of features. |
| EditorSettingsTitle | string | Text title displayed in the section for changing edit settings for snapping and feature selection. |
| EnableChangeSettings | bool | Whether to allow the user to change edit settings for snapping and feature selection. |
| EnableEditAttributes | bool | Whether to allow the user to change attributes of features. |
| EnableEditExistingFeature | bool | Whether to allow the user to modify the geometry or position of existing features. |
| EnableNewFeatureCreation | bool | Whether to allow the user to add new features. |
| FeatureHighlightColor | Color | The color to use for highlighting the feature selected for attribute editing. |
| FeatureSelectionColor | Color | Color to highlight features when selected by the user. |
| FeatureSelectionMode | FeatureSelectionMode | How features are to be selected with the SelectFeature tool. |
| MapResource | string | The map resource to be edited. |
| NotifyOnConflicts | bool | Whether to display a notification message when conflicts are detected and resolved while saving edits. |
| SelectionLimit | int | Maximum number of features selectable by the user. |
| SelectionTolerance | int | When selecting, features within this number of pixels of a click will be selected. |
| ShowFeatureHighlight | bool | Indicates if the feature whose attributes are shown in the attribute editor panel should be highlighted. |
| ShowSnapCircle | bool | Whether to display a circle around the cursor that indicates the snapping distance. |
| Snapping | StringList | The snapping rules to use while editing. |
| SnapTipColor | Color | When the user is using a tool with snapping enabled, and presses the 's' key, a marker will be displayed with this color at the location that will be snapped to. |
| SnapTolerance | int | Pixel distance within which snapping to a feature will occur. |
| TaskResultsContainers | BuddyControlCollection | The controls in which results from this task are displayed. |
| Title | string | Text displayed in the main title of the editor task window. |
| VersionIDs | StringList | A list of all of the versions that will be editable by the editor. If the editable layers are non-versioned, then this property is ignored. |
| VertexColor | Color | Color of vertices when displayed by the user. |
| EditorTask Event Type | Description |
|---|---|
| EditorPanelsCreated | Occurs when the editor panels (create feature, edit feature, edit attribute) are created. Can be used to add a custom panel to the main EditorTask panel. |
| PostAttributeEdit | This event is fired when an attribute edit has completed. |
| PostCommandExecute | An Editor command completed execution of its server action. |
| PostToolExecute | An Editor tool completed execution of its server action. |
| PreAttributeEdit | This event is fired when an attribute edit is about to be made. It may be used for input validation or cancellation of the edit. |
| PreCommandExecute | An Editor command is about to execute its server action. |
| PreToolExecute | An Editor tool is about to execute its server action. This would allow developers to target specific edits and possibly abort based on their own criteria or add their own logging. |
| SettingsPanelsCreated | Occurs when the settings panel is created (when the Settings link in the main EditorTask panel is clicked). Can be used to add a custom panel to the Settings panel. |
| SetVersion | Fired when the end-user selects a version from the version list. The version of the layers in the workspace being edited are set to the selected version. |
| ToolsCreated | Occurs when the tools in an existing toolbar, in an Editor panel, are created. Can be used to add a custom tool to an existing toolbar. |
| Editor Event Type | Description |
|---|---|
| LayerChanged | Occurs when the current edit layer changes via the drop down list in the Editor or when setting the geodatabase version. Can be used to interact with the edit layer via the ArcObjects IFeatureLayer interface. |
| EditorTask Event Argument Type | Description |
|---|---|
| EditorPanelsCreatedEventArgs | Created when the EditorPanelsCreated event occurs. Provides access to the existing panels on the main EditorTask panel. |
| PostAttributeEditEventArgs | Created when the PostAttributeEdit event occurs. Provides access to the feature and dataset that was edited. |
| PostCommandExecuteEventArgs | Created when the PostCommandExecute event occurs. Provides access to the editable feature layer and server context. |
| PostToolExecuteEventArgs | Created when the PostToolExecute event occurs. Provides access to the editable feature layer and server context. |
| PreAttributeEditEventArgs | Created when the PreAttributeEdit event occurs. Provides access to the feature and dataset being edited. |
| PreCommandExecuteEventArgs | Created when the PreCommandExecute event occurs. Provides access to the editable feature layer and server context. |
| PreToolExecuteEventArgs | Created when the PreToolExecute event occurs. Provides access to the editable feature layer and server context. |
| ToolsCreatedEventArgs | Created when the ToolsCreated event occurs. Provides access to the toolbars in the EditorTask. |



Customization Categories
The EditorTask was explicitly designed to support customization
in the following distinct, but related categories:
Recall that there are two options for developing a custom EditorTask solution; handle events on an out-of-the-box EditorTask control or subclass the EditorTask and its subcomponents. Both options will be discussed within the context of each category. A comprehensive sample is also included in this help system: Common_CustomEditorTask .
Option 1 uses an out-of-the-box EditorTask control and EditorTask events within the context of the page\control lifecycle to implement custom capabilities in each category. The diagram below highlights where these categories can be leveraged with option 1. Note that you can add event handlers during Page or EditorTask control lifecycle events (e.g Init, Load).
Option 2 demonstrates how to subclass existing EditorTask controls, override members, create new custom components, and construct a redistributable EditorTask component. All customization capabilities present in option 1 are available with option 2, plus those capabilities that are only available within a subclass solution (e.g. protected members). Note that instead of working with the event handler EditorTask and Editor events are now overridden in their respective subclass. The diagram below highlights where the implementation of each customization category may occur when extending the EditorTask.
EditorTask Events
Customizing an out-of-the-box EditorTask control will involve working with EditorTask events and event handlers. EditorTask event methods can be overridden in a subclassed EditorTask, but are not explicitly necessary. The diagrams included below list the event type, which EditorTask component triggers the event and when it is triggered (e.g. which method in the component). It is important to note that the CreateChildControls() method for all components is called between control load an page prerender upon the initial request, and between page init and page load during every postback\callback.
![]()
- EditorPanelsCreated
This event is triggered after the panels in the Editor are created during the CreateChildControls() method. Three panels are created: a CreateFeaturePanel, an EditExistingFeaturePanel, and an EditAttributesPanel panel. The event argument (EditorPanelsCreatedEventArgs) references a collection of panels. See the section on Custom Editor Panels below for more details.
- SettingsPanelsCreated
This event is triggered after the panels in the EditorSettingsPanel are created during the CreateChildControls() method. Two panels are created: SnappingPanel and SelectionPanel. The event argument (EditorPanelsCreatedEventArgs) references a collection of panels and can be used to add\remove or modify panels. See the section on Custom Editor Panels below for more details.
- ToolsCreated
This event can be triggered twice per request, once when the toolbar in the Editor control is created and again when the toolbars in the EditExistingFeaturePanel are created. The Editor control contains one toolbar with the id "MainToolbar". The EditExistingFeaturePanel contains two toolbars: "GeometryToolbar1" and "GeometryToolbar2". Note that the CreateFeaturePanel contains a toolbar, but it cannot be customized. Handle this event to remove\modify toolbar items on an existing toolbar, add new toolbar items, remove toolbars, or add new toolbars. Only toolbars and tools in the Editor and EditExistingFeaturePanel can be modified. The event argument (ToolsCreatedEventArgs) references the container, Editor or EditExistingFeaturePanel, via the Parent property. The Toolbars property contains a collection of toolbars in the respective parent. See the section on Custom Editor Tools for more details.
- SetVersion
This event is triggered via a postback\callback when a geodatabase version is selected in the VersionIDPanel. Handle this event to change EditorTask content or behavior based on a specific version. The event argument (SetVersionEventArgs) merely returns the selected version string.
- LayerChanged
This event is unique because the event handler is exposed on the Editor, not the EditorTask. It can be triggered via a postback\callback initiated by two actions in an Editor: when a geodatabase version is selected in the VersionIDPanel and when a layer is selected in the layer drop down list at the top of the Editor after a version has been selected. Handle this event to get a reference to the active editable feature layer and modify EditorTask behavior or prepare the feature layer for editing. The event argument (IFeatureLayer) provides access to the ArcObjects feature layer and feature class.
- PreAttributeEdit
This event is triggered when the value in a textbox in the EditAttributesPanel is changed and the textbox loses focus. A callback to the EditAttributesPanel calls the SaveEdit() method. Note, the SaveEdit() method cannot be overridden. The PreAttributeEdit event is triggered before an edit operation is initiated, namely a call to the ArcObjects IWorkspaceEdit.StartEditOperation(). Handle this event to modify the user provided attribute value or update other attributes during the same operation. The event argument (PreAttributeEditEventArgs) provides access to the IFeatureLayer, IFeature, and IField being edited and the new attribute value. You can also cancel the edit operation at this point by setting the Cancel property to true. The event also maintains the ReturnMessage property to send a message to the client in an alert box.
- PostAttributeEdit
Like the PreAttributeEdit event, this event is triggered when the value in a textbox in the EditAttributesPanel is changed and the textbox loses focus. A callback to the EditAttributesPanel calls the SaveEdit() method. The PostAttributeEdit event is triggered after an edit operation has occured, namely after a call to the ArcObjects IWorkspaceEdit.StopEditOperation(). Handle this event to modify information presented to the user or updated other related server-side content. The event argument (PostAttributeEditEventArgs) provides access to the IFeatureLayer, IFeature, IField and the new value that was used in the edit operation. You can also check to see if the operation was successful and if not, interrogate the exception. The event also maintains the ReturnMessage property to send a message to the client in an alert box.
- PreCommandExecute
This event is triggered when pressing a button in a toolbar in the EditorTask that initiates a callback to the Web application. The implementation code for the command is in a class that inherits from EditorServerCommandAction. A callback to the Toolbar control (may be an EditorToolbar) calls the EditorServerAction() method in the custom command action class. Note that the EditorServerCommandAction class is associated with a Toolbar control via an EditorCommand, a type of toolbar item.
The PreCommandExecute event is triggered before the EditorServerAction() method is executed. Handle this event to check edit layer properties or work with other content in the map service. This event is especially useful if you do not have access to the command source code or need to initiate the same set of actions before any one of a group of commands execute. The event argument (PreCommandExecuteEventArgs) provides access to the ServerAction class (EditorServerCommandAction class) which references a number of useful properties. The IMap, IMapServer, and server context of the map service associated with the command action are available. The ArcObjects IDataset and SOAP LayerDescription for the active edit layer are also provided. The ToolbarItemInfo property returns information about the EditorCommand toolbar item. Use the Editor property to get a reference to the Editor control. With the Editor control you can interact with current edit session properties, such as the active edit layer name, the MapFunctionality or MapResource associated with the EditorTask, or add custom CallbackResults to the callback response. You can also cancel the command by setting the Cancel property to true. The event also maintains the ReturnMessage property to send a message to the client in an alert box.
- PostCommandExecute
Like the PreCommandExecute event, this event is triggered when pressing a button in a toolbar in the EditorTask and the implementation code is in a class that inherits from EditorServerCommandAction.
The PostCommandExecute event is triggered after the EditorServerAction() method is executed. Handle this event to perform post command processing on the active edit layer or other content in the map service. The event argument (EditorCommandEventArgs) provides access to the ServerAction class which references a number of useful properties. This event argument exposes the same properties as PreCommandExecuteEventArgs minus the Cancel option.
![]()
- PreToolExecute
This event is triggered when applying a tool in a Map control associated with the EditorTask. The implementation code for the tool action is in a class that inherits from EditorServerToolAction. A callback to the Map control calls the EditorServerAction() method in the tool action class. Note that the EditorServerToolAction class is associated with a Toolbar control via an EditorTool, a type of toolbar item.
The PreToolExecute event is triggered before the EditorServerAction() method is executed. Handle this event to check edit layer properties, modify user provided input geometry, or work with other content in the map service. The event argument (PreToolExecuteEventArgs) provides access to the ServerAction class (EditorServerToolAction class) which references a number of useful properties. The IMap, IMapServer, and server context of the map service associated with the tool action are available. The ArcObjects IDataset and SOAP LayerDescription for the active edit layer are also provided. The ToolEventArgs provides access to the Map control in which the tool was applied; the same Map control that will generate a callback response. It also exposes the user provided geometry in screen units. The Geometry property on the event argument returns the ArcObjects geometry type in map units. Use the Editor property to get a reference to the Editor control. With the Editor control you can interact with current edit session properties, such as retrieving active edit layer name, the MapFunctionality or MapResource associated with the EditorTask, or refresh Editor content. You can also cancel the command by setting the Cancel property to true. The event also maintains the ReturnMessage property to send a message to the client in an alert box.
- PostToolExecute
Like the PreToolExecute event, this event is triggered when applying a tool in a Map control associated with the EditorTask. The implementation code for the tool action is in a class that inherits from EditorServerToolAction. A callback to the Map control calls the EditorServerAction() method in the tool action class. Note that the EditorServerToolAction class is associated with a Toolbar control via an EditorTool, a type of toolbar item.
The PostToolExecute event is triggered after the EditorServerAction() method is executed. Handle this event to confirm proper execution, initiate further actions, or work with other content in the map service. The event argument (EditorToolEventArgs) provides access to the ServerAction class (EditorServerToolAction class) which references a number of useful properties. This event argument exposes the same properties as the PreToolExecuteEventArgs minus the Cancel option.
Attribute Filtering
The EditorTask can be customized to filter attributes available for editing at runtime. The EditorTask has a property named AttributeDisplay which is a collection of AttributeDisplayInfo objects. The AttributeDisplayInfo class allows you to define how attributes are displayed for a specific layer using the DisplayMode enumeration. DisplayMode is defined as follows:
DisplayMode Enum Description Editable The attribute is displayed and editable. ReadOnly The attribute is shown as read-only (text in the textbox is grayed-out). Hidden The attribute is not shown.
The AttributeDisplayInfo class enables you to do two things:
1) Specify how attributes are displayed by default.
2) Define how specific fields are to be displayed using the Add method.
If you only want to display a few attributes, you can set the default display mode to “Hidden” (via the constructor or DefaultDisplayMode property) and explictly list the fields you want to display. Conversely, if you have many attributes and only want to hide a few, set DefaultDisplayMode to “Editable” or "ReadOnly" and then turn off the fields you want to hide. Here is a sample code snippet to illustrate filtering attributes on a layer using AttributeDisplayInfo. For customization option 1 (out-of-the-box EditorTask), filter attributes during initial Page Load or add an event handler on the EditorTask OnLoad event. For option 2 (custom EditorTask subclass), override the OnLoad event of the custom EditorTask class and filter attributes when the control is first loaded.
[C#]
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
FilterAttributes();
}
private void FilterAttributes()
{
AttributeDisplayInfo adi = new AttributeDisplayInfo(5, AttributeDisplayMode.Hidden);
adi.Overrides.Add(new AttributeDisplayOverride("STATE_NAME", AttributeDisplayMode.ReadOnly));
adi.Overrides.Add(new AttributeDisplayOverride("STATE_FIPS", AttributeDisplayMode.ReadOnly));
adi.Overrides.Add(new AttributeDisplayOverride("SUB_REGION", AttributeDisplayMode.ReadOnly));
adi.Overrides.Add(new AttributeDisplayOverride("POP1990", AttributeDisplayMode.ReadOnly));
adi.Overrides.Add(new AttributeDisplayOverride("POP1999", AttributeDisplayMode.Editable));
adi.Overrides.Add(new AttributeDisplayOverride("AVG_SALE87", AttributeDisplayMode.Editable));
EditorTask1.AttributeDisplay.AttributeDisplayInfos.Add(adi);
}
Using the code above, here are the before and after screenshots of the
EditorTask illustrating the changes in the attribute panel:
Custom Editor Toolbars and Toolbar Items
The out-of-the-box EditorTask includes a set of prepackaged toolbars and
toolbar items available for use at runtime. It also
includes a set of custom components to support EditorTask specific behavior in
toolbars, tools, and commands. The prepackaged
toolbars and toolbar items can be modified and new toolbars and toolbar items
can be added. In all cases, a toolbar in an EditorTask
will reside in the Editor or an editor panel. The technique for
accessing and modifying these toolbars as well as adding new toolbars and
toolbar items depends on the custom EditorTask solution (option 1 or
2).
Two containers in the EditorTask expose toolbars for customization: the Editor
and EditExistingFeaturePanel. The Editor contains a toolbar
named "MainToolbar" to manage selecting features and saving edits.
The EditExisingFeaturePanel contains two toolbars: "GeometryToolbar1" and
"GeometryToolbar2". "GeometryToolbar1" contains toolbar items to
manage complete feature edits. "GeometryToolbar2" contains toolbar items
to manage feature vertice edits.
If working with the out-of-the-box EditorTask (option 1), handle the
ToolsCreated event to gain access to a list of toolbars and their
parent. The ToolsCreated event will be called twice for every
request, once for the Editor and once for the
EditExistingFeaturePanel. Use the Parent property on
the ToolsCreatedEventArgs event argument to retrieve the parent control in
which the CreateToolbars() method was called. Use the Toolbars
property to return the toolbars in the parent. Existing
toolbars and toolbar items can be removed and custom toolbar items can be
added to existing toolbars. You can use the Toolbars
property to add and reorder toolbars to the current parent
container.
If creating a custom EditorTask control (option2), override the CreateToolbars
method in the custom Editor and/or
EditExistingFeaturePanel. In either case, call the
base.CreateToolbars() method to return the default toolbars.
The CreateToolbars() method is called during the execution of the
CreateChildControls() method. Existing toolbars and toolbar
items can be removed or modified while custom toolbars and toolbar items
can be added. In addition, custom toolbars and toolbar items can be
added to existing or new editor panels by overridding
and implementing the CreateChildControls() method, as is standard
when creating any custom Web control.
The EditorTask includes a set of custom classes and interfaces to use when
creating toolbars and toolbar items for use within an EditorTask.
These classes and interfaces wrap existing Web ADF toolbar components and
to be used within the events and operations specifically associated with the
EditorTask. Regardless of which customization option you choose, the same
set of EditorTask components are available for use. Most of
the toolbar and toolbar item components enhanced for use
with the EditorTask reside in the
ESRI.ArcGIS.ADF.ArcGISServer.Editor.Tools namespace.
ESRI.ArcGIS.ADF.ArcGISServer.Editor.Tools.EditorToolbar newEditorToolbar = new ESRI.ArcGIS.ADF.ArcGISServer.Editor.Tools.EditorToolbar(); newEditorToolbar.ToolbarStyle = ESRI.ArcGIS.ADF.Web.UI.WebControls.ToolbarStyle.ImageOnly; newEditorToolbar.ID = "MyCustomToolbar"; newEditorToolbar.BuddyControlType = ESRI.ArcGIS.ADF.Web.UI.WebControls.BuddyControlType.Map; newEditorToolbar.BuddyControls.Add (new ESRI.ArcGIS.ADF.Web.UI.WebControls.BuddyControl(EditorTask1.Editor.MapID));
| EditorServerToolAction class name | Description |
|---|---|
| AddVertex | Add a vertex to the current selected features. Included with GeometryToolbar2 in the EditExistingFeaturePanel. |
| CopyFeature | Copy the current selected features. Included with GeometryToolbar1 in the EditExistingFeaturePanel. |
| CreateFeature | Create a new feature using the type defined by the active edit layer. The CreateFeaturePanel includes a tool to create features based on the symbol classificiations in the active edit layer. This tool is generated internally by the CreateFeaturePanel - it does not use the CreateFeature tool. |
| DeleteVertex | Delete a vertex in the current selected features. Included with GeometryToolbar2 in the EditExistingFeaturePanel. |
| MoveFeature | Move the current selected features. Included with GeometryToolbar1 in the EditExistingFeaturePanel. |
| MoveVertex | Move a vertex in the current selected features. Included with GeometryToolbar2 in the EditExistingFeaturePanel. |
| SelectFeature | Select features in the active edit layer. Included with MainToolbar in the Editor. |
| SplitFeature | Splits the selected set of features with a user defined line. Included
with GeometryToolbar1 in the EditExistingFeaturePanel.
Calls IFeatureEdit.SplitWithUpdate(). |
| TrimFeature | Cuts the selected set of features with a user defined line. Not included in a out of the box toolbar. Calls ITopologicalOperator3.Cut(). |
namespace CustomEditorTask_CSharp
{
class ClipFeatures : EditorServerToolAction
{
private List<int> features = new List<int>();
public List<int> Features
{
get { return features; }
}
protected override void EditorServerAction()
{
IEnvelope agsCOMEnvelope = this.Geometry as IEnvelope
. . .
try
{
StartEditOperation();
. . .
agsCOMTopoOp3.Clip(agsCOMEnvelope);
agsCOMFeature.Store();
features.Add(agsCOMFeature.OID);
. . .
StopEditOperation();
} catch (Exception e) {
AbortEditOperation(e);
}
if (features.Count > 0)
{
Refresh(features, true);
}
}
}
}

EditorTool clip = new EditorTool("Clip", ParentEditor.MapID, false, ToolGeometry.Line
ToolGeometry.Polygon, 1);
clip.ClientAction = Constants.HTML_DRAG_RECTANGLE;
clip.DefaultImage = this.Page.ClientScript.GetWebResourceUrl(typeof(CustomEditorTask),
"CustomEditorTask_CSharp.images.clip.png");
clip.SelectedImage = this.Page.ClientScript.GetWebResourceUrl(typeof(CustomEditorTask),
"CustomEditorTask_CSharp.images.clip_ON.png");
clip.HoverImage = this.Page.ClientScript.GetWebResourceUrl(typeof(CustomEditorTask),
"CustomEditorTask_CSharp.images.clip_OVER.png");
clip.ToolTip = "Clip feature(s)";
clip.ServerActionAssembly = "CustomEditorTask_CSharp";
clip.ServerActionClass = "CustomEditorTask_CSharp.ClipFeatures";
newEditorToolbar.ToolbarItems.Add(clip);
| EditorServerCommandAction class name | Description |
|---|---|
| ClearSelection | Clears selected features in active edit layer. Included with MainToolbar in the Editor. |
| DeleteFeature | Delete the selected features in the active edit layer. Included with GeometryToolbar1 in the EditExistingFeaturePanel. |
| MergeFeature | Merge the selected features in the active edit layer. Included with
GeometryToolbar1 in the EditExistingFeaturePanel.
Calls ITopologicalOperator3.Union() |
| SetEditState | Handles commands associated with non-pooled and versioned edit
operations. The buttons to save, undo and redo edits included with
MainToolbar in the Editor use this command class. |
| ShowVertex | Show vertices of the selected feature in the active edit layer. Included with MainToolbar in the Editor. |
namespace CustomEditorTask_CSharp
{
class PolygonToLine : EditorServerCommandAction
{
private List<int> features = new List<int>();
public List<int> Features
{
get { return features; }
}
protected override void EditorServerAction()
{
. . .
try
{
StartEditOperation();
. . .
agsCOMNewFeature = DestinationFeatureClass.CreateFeature();
agsCOMNewFeature.Shape = agsCOMTopoOp3.Boundary;
agsCOMNewFeature.Store();
features.Add(agsCOMNewFeature.OID);
. . .
StopEditOperation();
} catch (Exception e) {
AbortEditOperation(e);
}
if (features.Count > 0)
{
Refresh(features, true);
}
}
}
}

EditorCommand ptl = new EditorCommand("PolygonToLine", ToolGeometry.Polygon, 1);
ptl.DefaultImage = this.Page.ClientScript.GetWebResourceUrl(typeof(CustomEditorTask),
"CustomEditorTask_CSharp.images.polygon2line.png");
ptl.SelectedImage = this.Page.ClientScript.GetWebResourceUrl(typeof(CustomEditorTask),
"CustomEditorTask_CSharp.images.polygon2line_ON.png");
ptl.HoverImage = this.Page.ClientScript.GetWebResourceUrl(typeof(CustomEditorTask),
"CustomEditorTask_CSharp.images.polygon2line_OVER.png");
ptl.ToolTip = "Convert polygon feature(s) to polylines";
ptl.ServerActionAssembly = "CustomEditorTask_CSharp";
ptl.ServerActionClass = "CustomEditorTask_CSharp.PolygonToLine";
newEditorToolbar.ToolbarItems.Add(ptl);
Custom Editor Panels
The out-of-the-box EditorTask includes a set of prepackaged editor
panels for use at runtime. By default, there are two
parent panels included with the Editor task: Editor and
EditorSettingsPanel. Both include a set of subpanels which contain
logically grouped functionality. The EditorTask also includes a set
of components to support extending existing editor panels and creating new
editor panels. EditorPanel extends the Web ADF FloatingPanel,
and provides access to the parent EditorTask, Editor, and the feature layer
associated with the active edit layer. TooledEditorPanel extends
EditorPanel by defining a collection of toolbar items which can be
populated by overriding the CreateToolbars() method. Any subclass of
TooledEditorPanel (e.g. EditExistingFeaturePanel) will trigger
the ToolsCreated event on the EditorTask when
CreateToolbars() returns.
The technique for accessing and modifying panels depends on
the custom EditorTask solution (option 1 or 2). Note that the
content of an editor panel will may contain an editor toolbar and toolbar
items, discussed in the previous section.
The Editor contains three editor panels by default. Each panel is
available via a property on the Editor and contains prepackaged
functionality. At a minimum, each panel is a type of EditorPanel.
| Editor property | Description |
|---|---|
| NewFeatureCreator | Returns an instance of the CreateFeaturePanel. |
| ExistingFeatureEditor | Returns an instance of the EditExistingFeaturePanel. Subclasses TooledEditorPanel. |
| AttributesEditor | Returns an instance of the EditAttributesPanel. |
| EditorPanels | Returns a collection of editor panels contained by the Editor. |
| EditorSettingsPanel property | Description |
|---|---|
| SnappingPanel | Returns an instance of the SnappingPanel. |
| EditorPanels | Returns a collection of the editor panels contained by the EditorSettingsPanel. Includes a reference to the SelectionPanel. |
public class MyPanel : EditorPanel
{
public MyPanel(string title, EditorTask task, string ID) : base(title, task, ID) { }
protected override void RenderContents(HtmlTextWriter writer)
{
writer.Write("This is my custom panel");
}
}
By adding this class to the App_Code folder of the EditorTask web application,
the custom panel can be added to the out-of-the-box EditorTask with the
following EditorPanelsCreated event handler code:
[C#]
protected void EditorTask1_EditorPanelsCreated(object sender, EditorPanelsCreatedEventArgs e)
{
MyPanel panel = new MyPanel("My Custom Panel", EditorTask1, "myPanelID");
e.EditorPanels.Insert(0, panel);
}
At runtime, the custom panel will appear as follows. Note, in the code
above the custom panel was inserted into the first position in the EditorPanel
collection (index 0) so that the custom panel is displayed above the other
standard EditorPanel panels.

Similarly, a custom panel can be added or can replace an existing panel when
creating a custom EditorTask control (option 2). In addition,
you can also subclass the Editor and EditorSettingPanel class and override the
CreateEditorPanels() method to define which panels are added. The
CreateEditorPanels() method is called in the CreateChildControls() method for
each class. A call to base.CreateEditorPanels() will return the default
panels available in each container (Editor and
EditorSettingsPanels). You can either modify this collection
or replace it. If you replace an existing panel with a custom
panel (e.g. replace the existing CreateFeaturePanel with a new panel
to create features) override the appropriate method listed in the table
below:
| Editor method | Description |
|---|---|
| CreateCreateFeaturePanel | Override to create a new instance of a create feature panel. Returns a type of EditorPanel. |
| CreateEditExistingFeaturePanel | Override to create a new instance of an edit existing feature panel. Returns a type of EditorPanel. |
| CreateEditAttributesPanel | Override to create a new instance of an edit attributes panel. Returns a type of EditorPanel. |
| CreateEditorPanels | Override to modify the panels created for the Editor. Returns a list of editor panels. |
The Editor and EditorSettingsPanel share the technique for overriding
CreateEditorPanels() to set the panels in either container. However, the
EditorSettingsPanel does not require you to override another method when
replacing a SnappingPanel or SelectionPanel. If replacing the existing
SnappingPanel with a new panel that subclasses SnappingPanel (not just
EditorPanel), override the SnappingPanel property. The property
should return a reference to the new panel created in
CreateEditorPanels().
| EditorSettingsPanel method | Description |
|---|---|
| CreateEditorPanels | Override to modify the panels created for the EditorSettingPanel. Returns a list of editor panels. |
public class CustomEditorSettingsPanel : EditorSettingsPanel
{
protected override List<EditorPanel> CreateEditorPanels()
{
List<EditorPanel> panels = new List<EditorPanel>();
CustomEditorTask customEditorTask = (CustomEditorTask)this.Task;
EditorPanel snappingPanel = null;
if (customEditorTask.UseMapUnitsForSnapping)
{
snappingPanel = new CustomSnappingPanel(this.Task);
snappingPanel.Visible = true;
}
else
{
snappingPanel = new SnappingPanel(this.Task);
}
panels.Add(snappingPanel);
EditorPanel selectionPanel = new SelectionPanel(this.Task);
panels.Add(selectionPanel);
PolygonToLineLayerEditorPanel customPolygonToLinePanel =
new PolygonToLineLayerEditorPanel("Polygon to Polyline Settings",
this.Task, "P2PPanel");
panels.Add(customPolygonToLinePanel);
return panels;
}
}
public class CustomEditorTask : ESRI.ArcGIS.ADF.ArcGISServer.Editor.EditorTask
{
protected override ESRI.ArcGIS.ADF.ArcGISServer.Editor.Editor CreateEditor()
{
return new CustomEditor(this);
}
}