1

mvc 2010 Expressを使用してc#でアプリケーションを作成しています。次のコードでビューが 1 つあります。

@model IEnumerable<AlianIntranet.Models.DB.v_CountriesMarkets>

@{
    WebGrid grid = new WebGrid(Model, defaultSort: "CountryName");
}

<div class="centTable">
    @grid.GetHtml(
        fillEmptyRows: true,
        rowStyle: "normalRow",
        alternatingRowStyle: "alternatingRow",
        selectedRowStyle: "selectedRow",
        tableStyle: "tablemod-style",
        headerStyle: "header-grid",
        footerStyle: "footer-grid",

        columns: new[] {
            grid.Column("CountryName", style: "pamerc", header: "Country"),
            grid.Column("Market", style: "pamerc", header: "Market")
    })
</div>

結果がたくさんあっても、結果を 1 ページだけに表示するように求められました。(これが、のようないくつかのプロパティを消去した理由ですmode)そうする簡単な方法があるに違いないと確信していますが、それを見つけることができません。

誰か助けてくれませんか?前もって感謝します。

4

1 に答える 1

2

ページングを無効にするには、WebGrid コンストラクターの canPage パラメーターを使用します。

@{
    var grid = new WebGrid(canPage: false,
      // ... etc
    );
}
于 2013-09-13T12:46:34.650 に答える