TaskResults 控件使用方法

The TaskResults control is designed to store the results of tasks that produce ADO.NET DataSet output.  The results are presented as nodes in a TreeView.  The TaskResults control also enables the ability to zoom or pan to a feature, highlight a feature in a result set, re-run a task, or remove task results.  
Assembly: ESRI.ArcGIS.ADF.Web.UI.WebControls.dll
Class: ESRI.ArcGIS.ADF.Web.UI.WebControls.TaskResults
JavaScript libraries: display_common.js, display_dotnetadf.js, display_taskresults.js, display_treeviewplus.js, display_contextmenu.js
Using the TaskResults control
  1. Add supporting controls to the page

    In order to take full advantage of the TaskResults control, a number of supporting controls must be available.  Set up a Web application with a MapResourceManager and Map control using their discussion topics as a guide. Add a TaskManager, Menu and a SearchAttributesTask control using their discussion topics as a guide. At runtime, the TaskResults control displays the results of executing the task. A user can then interact with the results to change map extent, display selected features, or re-execute the task. 

    The TaskResults accepts the results output from other task controls as well. These include QueryAttributesTask, FindAddressTask, and FindPlaceTask. It can also accept results from custom tasks. Use the same logic as discussed below to buddy the task to the TaskResults control (step 4 below).
  2. Add the TaskResults control to the page

    In Visual Studio, open a Web form in design mode, select the Toolbox, and expand the ArcGIS Web Controls tab.  Drag and drop a TaskResults control on the Web form.  You should now see the following in Visual Studio:


  3. Buddy the TaskResults control to the Map control

    This step is only required if you want to interactively work with results in the Map.   Set the Map property on the TaskResults control to buddy it with a Map control.


  4. Buddy the task control with the TaskResults control

    To display the results of a task, you must buddy the task control with the TaskResults control.  Select the task control (in this example, the SearchAttributesTask control) and modify the TaskResultsContainers property.  In the buddy control dialog, add a new item and select the id of the TaskResults control you want to display the task results. 

  5. Run the application and execute the task

    When a task is executed at runtime, the TaskResults control displays an animated gif to indicate that the task is working.  A Cancel link is also displayed to cancel the task before it completes.  In the following example, the task is searching the US States layer for state names that contain the text "New".  The arrow indicates the location of the task execution indicator in the TaskResults control. 


  6. Navigate the results of a task

    When task execution completes, the results are returned in the TaskResults control in a TreeView.  A user can expand and collapse the branches of the results collection to view result items.  If attributes are returned, a user can expand its branch to view feature attribute values.  If features are returned, check the box next to the result item to highlight it in the map.


  7. Using the context menu on the result items

    A user can right-click the context menu on a result item and select from the following options:
    a) Zoom to - zoom to the result item in the map
    b) Pan to - pan the map to center on the result item
    c) Remove - remove the result item from the task results list 

  8. Using the context menu on the task results 

    A user can right-click the context menu on the task results collection to:
    a) Run task again - display the task dialog again with the settings of this task result collection
    b) Refresh - execute the same task again and update this task result collection
    c) Remove - remove this task results collection from the TaskResults control

  9. Display multiple task results in the TaskResults control

    Each time a task is executed, a new results collection is created in the TaskResults control.

转载于:https://www.cnblogs.com/cmleung/archive/2011/04/10/2011253.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值