共用方式為


DetailsViewDesigner.SampleRowCount 屬性

定義

取得要讓關聯控制項顯示的範例資料列數。

protected:
 virtual property int SampleRowCount { int get(); };
protected override int SampleRowCount { get; }
member this.SampleRowCount : int
Protected Overrides ReadOnly Property SampleRowCount As Integer

屬性值

Int32

要顯示的範例資料列數。

範例

下列程式碼範例示範如何覆寫 SampleRowCount 繼承自 DetailsViewDesigner 類別的 類別中的 屬性,以變更在設計階段出現在 控制項的呼叫器資料列中 DetailsView 的頁面連結數目。 此範例會導致顯示五個頁面連結。

// Determines the number of page links in the pager row
// when viewed in the designer.
protected override int SampleRowCount
{
    get
    {
        // Render five page links in the pager row.
        return 5;
    }
} // SampleRowCount
' Determines the number of page links in the pager row
' when viewed in the designer.
Protected Overrides ReadOnly Property SampleRowCount() As Integer
    Get
        ' Render five page links in the pager row.
        Return 5
    End Get
End Property ' SampleRowCount

備註

屬性 SampleRowCount 一律會傳回數位 2 。 這會導致設計階段在控制項的 DetailsView 呼叫器列中顯示兩個頁面連結。

適用於

另請參閱