ESRI.ArcGIS.ADF.Web.UI.WebControls
BuddyControls Field
See Also  Example
ESRI.ArcGIS.ADF.Web.UI.WebControls.Tools Namespace > ToolbarItemInfo Class : BuddyControls Field




The controls which the toolbar is buddied, either Map or PageLayout controls.

Syntax

Visual Basic (Declaration) 
<NonSerializedAttribute()>
Public BuddyControls As WebControl()
Visual Basic (Usage)Copy Code
Dim instance As ToolbarItemInfo
Dim value() As WebControl
 
value = instance.BuddyControls
 
instance.BuddyControls = value
C# 
[NonSerializedAttribute()]
public WebControl[] BuddyControls

Example

This code obtains a reference to a Map to which the Toolbar is buddied in order to zoom the map to full extent.

In the code, info is the ToolbarItemInfo passed to the ServerAction from a command. The code assumes that the Toolbar is buddied to a Map control.

C#Copy Code
ESRI.ArcGIS.ADF.Web.UI.WebControls.Map mapctrl = 

  (ESRI.ArcGIS.ADF.Web.UI.WebControls.Map)info.BuddyControls[0]; 

mapctrl.ZoomToFullExtent(); 

    
Visual BasicCopy Code
Dim mapctrl As ESRI.ArcGIS.ADF.Web.UI.WebControls.Map

mapctrl = CType(info.BuddyControls(0), ESRI.ArcGIS.ADF.Web.UI.WebControls.Map)

mapctrl.ZoomToFullExtent()

Remarks

Typically a Toolbar is buddied to a Map or PageLayout control. The items on the toolbar will then operate on the Map or PageLayout. These buddy controls are specified by the Toolbar's BuddyControls property. The BuddyControls property of the ToolbarItemInfo object is a reference to this collection of controls.

Most often this property is used to obtain a reference to the Map on which the command or drop-down box will operate. For example, a "Full Extent" command button can have a server-side action that zooms the map to the extent of all layers. In order to zoom the map, the code that received the ToolbarItemInfo object can get the map using code such as in the Example, and then use the Map's methods to zoom the map.

See Also

© 2010 All Rights Reserved.