Uredi

Deli z drugimi prek


DesignerActionItem.AllowAssociate Property

Definition

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

Property Value

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

Remarks

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

Applies to

See also