MenuItem.DataItem 屬性

定義

取得繫結至功能表項目的資料項目。Gets the data item that is bound to the menu item.

public:
 property System::Object ^ DataItem { System::Object ^ get(); };
[System.ComponentModel.Browsable(false)]
public object DataItem { get; }
[<System.ComponentModel.Browsable(false)>]
member this.DataItem : obj
Public ReadOnly Property DataItem As Object

屬性值

Object

Object,表示繫結至功能表項目的資料項目。An Object that represents the data item that is bound to the menu item. 預設值為 null,表示功能表項目未繫結至任何資料項目。The default value is null, which indicates that the menu item is not bound to any data item.

屬性

備註

當控制項系結 Menu 至資料來源(例如 XmlDataSource 物件)時,這個屬性會設定為系結至這個特定功能表項目的資料項目。When the Menu control is bound to a data source, such as an XmlDataSource object, this property is set to the data item that is bound to this specific menu item. 這個屬性通常用來存取資料項目的值。This property is commonly used to access the value of the data item.

注意

只有在資料系結髮生之後,才可以使用這個屬性。This property is available only after data binding has occurred.

適用於

另請參閱