TaskResults control


In this topic


About the TaskResults control

The TaskResults control stores results for tasks that produce ADO.NET DataSet output. The results are presented as nodes in a TreeView. The TaskResults control can zoom or pan to a feature, highlight a feature in a result set, rerun a task, or remove task results.  
For information on creating and modifying a TaskResults control, see Creating and modifying contents of a TaskResults control.

Using the control

  1. To use the TaskResults control, add supporting controls to the page. Set up a Web application with a MapResourceManager and Map control. Add a TaskManager, Menu, and SearchAttributesTask control. At runtime, the TaskResults control displays the results of executing the task. You can then interact with the results to change the map extent, show selected features, or re-execute the task.

    The TaskResults accepts the result output from other task controls, which includes QueryAttributesTask, and FindAddressTask. It can also accept results from custom tasks. Use the same logic as discussed in Step 4 to buddy the task to the TaskResults control.
  2. To add a TaskResults control, in Visual Studio, open a Web form in design mode, select the Toolbox panel, and expand the ArcGIS Web Controls tab. Drag and drop a TaskResults control on the Web form. See the following screen shot that shows the controls on the page in Visual Studio:

     
  3. Set the Map property on the TaskResults control to buddy it with a Map control. This step is only required if you want to interactively work with results on the Map. See the following screen shot:


  4. To show the task results, buddy the task control with the TaskResults control. Select the task control (in this step, the SearchAttributesTask control) and modify the TaskResultsContainers property. On the BuddyControl Collection Editor dialog box, add a new item and select the ID of the TaskResults control you want to display the task results. See the following screen shot:

     
  5. Run the application and execute the task. When a task is executed at runtime, the TaskResults control displays an animated .gif image that indicates the task is working. Click Cancel if you want to exit the task before it completes.

    The following screen shot shows the task searching the US States layer for state names containing "New" as the search text. The arrow indicates the location of the task execution indicator in the TaskResults control.


  6. When the task execution completes, the results are returned in the TaskResults control in a tree view. You can expand and collapse the nodes for the results collection to view items. If attributes are returned, you can expand its branches to view feature attribute values. If features are returned, they are rendered on the map using client-side graphics. By default, the check boxes next to the results are selected. Hover over a feature node to highlight the corresponding graphic feature on the map. See the following screen shot:


  7. Right-click a result item and select from the following options on the context menu:
    • Zoom to—Zooms to the result item on the map.
    • Pan to—Pans the map to center on the result item.
    • Remove—Removes the result item from the task results list.

      See the following screen shot:


  8. One task results node can contain multiple result item collections, referred to programmatically as graphic nodes. Right-click the task results collection and select from the following options on the context menu:
    • Zoom To Selected Features—Zooms to the map extent that includes the results in the collection.
    • Remove—Removes this result item collection from the TaskResults control.

      See the following screen shot:


  9. Right-click the result items and select from the following options on the context menu:
    • Rerun task—Executes the same task again and updates this task result collection.
    • Remove—Removes this task results collection from the TaskResults control.

      See the following screen shot:


  10. Client graphics are generated for task results by default; therefore, the graphic feature associated with results have MapTips enabled. MapTips and result content can be modified at design time on the specific task control buddied to the TaskResults control. See the following screen shot:

     
  11. Display multiple task results in the TaskResults control. Each time a task is executed, a new task results collection is created in the TaskResults control. See the following screen shot:

      

Members

The following table shows a list of properties related to the TaskResults control. For more reference information, see the TaskResults control in the library reference section.
Property name
Type
Description
Map
string
Map control ID to which the TaskResults control is buddied to.
GraphicsTransparency
float
Transparency percentage for graphic features associated with the results. 0 equals opaque and 100 equals transparent.
ResultsInsertLocation
ResultsInsertLocation
Location in the TaskResults control where new results are added. Top of the list is the default.
ZoomToPointFactor
double
When zooming to points, the value the full extent is divided by to calculate the extent to zoom to.


See Also:

Working with the TaskResult control
Web ADF controls




To use the code in this topic, reference the following assemblies in your Visual Studio project. In the code files, you will need using (C#) or Imports (VB .NET) directives for the corresponding namespaces (given in parenthesis below if different from the assembly name):
  • ESRI.ArcGIS.ADF.Web.UI.WebControls.dll