IDataItemContainer.DisplayIndex IDataItemContainer.DisplayIndex IDataItemContainer.DisplayIndex IDataItemContainer.DisplayIndex Property

定義

實作時,取得控制項中所顯示之資料項目的位置。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

屬性值

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

範例

下列程式碼範例示範DisplayIndex屬性的執行。The following code example demonstrates an implementation of the DisplayIndex property. 這是IDataItemContainer類別總覽主題中較大範例的一部分。It 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.

適用於

另請參閱