Common_TaskResults_CSharp\TaskResultsWebSite\SimpleResult.aspx.cs
// Copyright 2010 ESRI // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // You may freely redistribute and use this sample code, with or // without modification, provided you include the original copyright // notice and use restrictions. // // See the use restrictions. // public partial class SimpleResult : System.Web.UI.Page { protected void Toolbar1_CommandClick(object sender, ESRI.ArcGIS.ADF.Web.UI.WebControls.ToolbarCommandClickEventArgs toolbarCommandClickEventArgs) { // Check to make sure our custom command was clicked. This is not necessary in this case since there // is only one item on the toolbar, but is included here for demonstration. switch (toolbarCommandClickEventArgs.CommandName) { case ("CreateSimpleResult"): // Create a parent node and assign it a remove-only context menu ESRI.ArcGIS.ADF.Web.UI.WebControls.TaskResultNode headingTaskResultNode = new ESRI.ArcGIS.ADF.Web.UI.WebControls.TaskResultNode("Heading"); TaskResults1.SetupContextMenu(TaskResults1.RemoveOnlyContextMenu, headingTaskResultNode); // Create a child node and assign it a remove-only context menu ESRI.ArcGIS.ADF.Web.UI.WebControls.TreeViewPlusNode detailTreeViewPlusNode = new ESRI.ArcGIS.ADF.Web.UI.WebControls.TreeViewPlusNode("Detail"); TaskResults1.SetupContextMenu(TaskResults1.RemoveOnlyContextMenu, detailTreeViewPlusNode); // Add the child node to the parent and call EnsureVisible to make sure the parent node // is not collapsed. Note that EnsureVisible must be called after the node is added. headingTaskResultNode.Nodes.Add(detailTreeViewPlusNode); detailTreeViewPlusNode.EnsureVisible(); // Display the custom node by passing it to DisplayResults TaskResults1.DisplayResults(null, null, null, headingTaskResultNode); // Copy the TaskResults control's callback results to the Toolbar so they are processed // on the client Toolbar1.CallbackResults.CopyFrom(TaskResults1.CallbackResults); break; } } }