DesignerActionItem.AllowAssociate 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定值,指出是否允許這個項目置於具有相同 Category 屬性值的項目群組中。
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
屬性值
如果可以將項目群組,則為 true,否則為 false。 預設為 false。
備註
因為多個 DesignerActionList 物件可以合併成單一智慧標記面板,所以 AllowAssociate 屬性會指出目前的專案是否可以依類別重新排列。
屬性AllowAssociate會與 RelatedComponent 和 DesignerActionPropertyItem 類型的 屬性DesignerActionMethodItem搭配使用。
例如,ASP.NET 使用資料綁定控制項,例如 GridView 連線到資料源控件,例如 SqlDataSource。 兩者都有 DesignerActionList 一組 DesignerActionItem 自己的物件。 控制件GridView具有、 Edit Fields和AutoFormat等DataSourceID專案。 類別 SqlDataSource 具有 Configure 和 Refresh Items,其已 AllowAssociate 設定為 true。
控件 GridView 的專案 DataSourceID 具有相關的元件,也就是 SqlDataSource 物件。
SqlDataSource所有已AllowAssociate設定true為的物件專案都會自動包含在GridView控件的動作清單中。 下表顯示兩個清單如何在控件的設計工具動作清單中合併 GridView 。
| GridView 專案 | SqlDataSource 專案 |
|---|---|
-
DataSourceID (相關元件 = SqlDataSource) - 編輯欄位 - 自動格式設定 |
- 設定 (AllowAssociate = true) - 重新整理 ( AllowAssociate = true) |
| 合併的 GridView 控件智慧工作面板 |
|---|
| - DataSourceID -配置 -刷新 - 編輯欄位 - 自動格式設定 |