DesignerActionItem.AllowAssociate 属性

定义

获取或设置一个值,该值表示是否允许将此项放入具有相同 Category 属性值的一组项中。Gets or sets a value indicating whether to allow this item to be placed into a group of items that have the same Category property value.

public:
 property bool AllowAssociate { bool get(); void set(bool value); };
public bool AllowAssociate { get; set; }
member this.AllowAssociate : bool with get, set
Public Property AllowAssociate As Boolean

属性值

Boolean

如果该项可以组合,则为 true;否则为 falsetrue if the item can be grouped; otherwise, false. 默认为 falseThe default is false.

注解

由于可能会组合多个 DesignerActionList 对象以形成单个智能标记面板,因此 AllowAssociate 属性指示当前项是否可以按类别重新排列。Because multiple DesignerActionList objects may be combined to form a single smart tag panel, the AllowAssociate property indicates whether the current item can be rearranged by category.

AllowAssociate属性与和类型的属性结合使用 RelatedComponent DesignerActionMethodItem DesignerActionPropertyItemThe AllowAssociate property is used in conjunction with the RelatedComponent property on the DesignerActionMethodItem and DesignerActionPropertyItem types.

例如,ASP.NET 使用类似的数据绑定控件 GridView 连接到数据源控件(如) SqlDataSourceFor example, ASP.NET uses a data-bound control like GridView to connect to a data source control like SqlDataSource. 两者都具有 DesignerActionList 自己的一组 DesignerActionItem 对象。Both have a DesignerActionList with its own set of DesignerActionItem objects. GridView控件包含 DataSourceID 、和等项 Edit Fields AutoFormatThe GridView control has items like DataSourceID, Edit Fields, and AutoFormat. SqlDataSource类具有 ConfigureRefresh Items ,它 AllowAssociate 设置为 trueThe SqlDataSource class has Configure and Refresh Items, which have AllowAssociate set to true.

GridView控件的 DataSourceID 项具有相关组件,即 SqlDataSource 对象。The GridView control's DataSourceID item has a related component, which is the SqlDataSource object. 所有 SqlDataSource 设置为的对象项将 AllowAssociate true 自动包含在 GridView 控件的操作列表中。All the SqlDataSource object's items that have AllowAssociate set to true are automatically included in the GridView control's action list. 下表显示了如何在 GridView 控件的设计器操作列表中合并两个列表。The following table shows how the two lists are merged in the GridView control's designer action list.

GridView 项GridView items SqlDataSource 项SqlDataSource items
- DataSourceID (相关组件 = SqlDataSource) - DataSourceID (related component = SqlDataSource)
-编辑字段- Edit Fields
-自动套用格式- AutoFormat
-配置 (AllowAssociate = true) - Configure (AllowAssociate = true)
-刷新 (AllowAssociate = true) - Refresh (AllowAssociate = true)
合并的 GridView 控件的 "智能任务" 面板Merged GridView control's smart tasks panel
-DataSourceID- DataSourceID
-配置- Configure
-刷新- Refresh
-编辑字段- Edit Fields
-自动套用格式- AutoFormat

适用于

另请参阅