IDataItemContainer.DisplayIndex 屬性

定義

實作時,取得控制項中所顯示之資料項目的位置。When implemented, gets the position of the data item as displayed in a control.

public:
 property int DisplayIndex { int get(); };
public int DisplayIndex { get; }
member this.DisplayIndex : int
Public ReadOnly Property DisplayIndex As Integer

屬性值

Int32

Integer,表示控制項中所顯示之資料項目的位置。An Integer representing the position of the data item as displayed in a control.

範例

下列程式碼範例示範屬性的執行 DisplayIndexThe following code example demonstrates an implementation of the DisplayIndex property. 它是類別總覽主題中較大範例的一部分 IDataItemContainerIt is part of a larger example in the IDataItemContainer class overview topic.

int IDataItemContainer.DisplayIndex
{
    get
    {
        return _itemIndex;
    }
}
ReadOnly Property DisplayIndex() As Integer Implements IDataItemContainer.DisplayIndex
    Get
        Return _itemIndex
    End Get
End Property

備註

在的實類別(例如 DataGridViewColumn )中, DisplayIndex 會根據所顯示資料列中資料列的索引來設定屬性。In implementing classes such as DataGridViewColumn, the DisplayIndex property is set according to the index of the row among the displayed rows.

適用於

另請參閱