AllowAssociate Property

DesignerActionItem.AllowAssociate Property


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.

Namespace:   System.ComponentModel.Design
Assembly:  System.Design (in System.Design.dll)

public bool AllowAssociate { get; set; }

Property Value

Type: System.Boolean

true if the item can be grouped; otherwise, false. The default is false.

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.

The AllowAssociate property is used in conjunction with the RelatedComponent property on the DesignerActionMethodItem and DesignerActionPropertyItem types.

For example, ASP.NET uses a data-bound control like GridView to connect to a data source control like SqlDataSource. Both have a DesignerActionList with its own set of DesignerActionItem objects. The GridView control has items like DataSourceID, Edit Fields, and AutoFormat. The SqlDataSource class has Configure and Refresh Items, which have AllowAssociate set to true.

The GridView control's DataSourceID item has a related component, which is the SqlDataSource object. All the SqlDataSource object's items that have AllowAssociate set to true are automatically included in the GridView control's action list. The following table shows how the two lists are merged in the GridView control's designer action list.

GridView items

SqlDataSource items

  • DataSourceID (related component = SqlDataSource)

  • Edit Fields

  • AutoFormat

  • Configure (AllowAssociate = true)

  • Refresh (AllowAssociate = true)

Merged GridView control's smart tasks panel

  • DataSourceID

  • Configure

  • Refresh

  • Edit Fields

  • AutoFormat

.NET Framework
Available since 2.0
Return to top
© 2015 Microsoft