GridView.AllowPaging プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > GridView.AllowPaging プロパティの意味・解説 

GridView.AllowPaging プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

ページング機能が有効かどうかを示す値を取得または設定します

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Overridable Property
 AllowPaging As Boolean
Dim instance As GridView
Dim value As Boolean

value = instance.AllowPaging

instance.AllowPaging = value
public virtual bool AllowPaging { get;
 set; }
/** @property */
public boolean get_AllowPaging ()

/** @property */
public void set_AllowPaging (boolean value)

プロパティ
ページング機能有効な場合trueそれ以外場合false既定値false です。

解説解説

GridView コントロールでは、データ ソース内のすべてのレコード同時に表示せずに、自動的にレコード複数ページ分割できますデータ ソースページング機能サポートされている場合GridView コントロールは、その機能利用して組み込みページング機能を提供できますページング機能は、System.Collections.ICollection インターフェイスサポートするデータ ソース オブジェクト、またはページング機能サポートするデータ ソース使用できます

ページング機能有効にするには、AllowPaging プロパティtrue設定します既定では、GridView コントロール一度1 ページあたり 10 個のレコード表示します。PageSize プロパティ設定してページ表示されるレコード数を変更できますデータ ソース内容表示するために必要な合計ページ数を確認するには、PageCount プロパティ使用します。PageIndex プロパティ使用して、現在表示されているページインデックス確認できます

ページング有効になっている場合ページ行と呼ばれる追加行が自動的に GridView コントロール表示されます。ページ行には、ユーザーが他のページ移動できるコントロール含まれています。ページ行の設定 (ページャ表示モード一度表示するページ リンクの数、ページャ コントロールテキスト ラベルなど) は、PagerSettings プロパティ使用して制御できますページ行は、Position プロパティ設定することによって、コントロールの上部、下部または上部下部両方表示できますまた、Mode プロパティ設定して4 つ組み込みページャ表示モードいずれか選択することもできます。この組み込み表示モード次の表に示します

ページ行の外観 (背景色フォントの色、位置など) を制御するには、PagerStyle プロパティ使用します

GridView コントロールでは、ページ行用のカスタム テンプレートも定義できますカスタム ページテンプレート作成詳細については、PagerTemplate のトピック参照してください

GridView コントロールには、ページング発生したときにカスタム アクション実行するために使用できる複数イベント用意されています。使用できるイベントの一覧を次の表に示します

使用例使用例

AllowPaging プロパティ使用してGridView コントロールページング機能宣言によって有効にする方法次のコード例示します

<%@ Page language="VB" %>

<html>
  <body>
    <form runat="server">
        
      <h3>GridView AllowPaging Example</h3>

      <asp:gridview id="CustomersGridView" 
        datasourceid="CustomersSource" 
        autogeneratecolumns="true"
        emptydatatext="No data available." 
        allowpaging="true" 
        runat="server">
                
        <pagersettings mode="Numeric"
          position="Bottom"           
          pagebuttoncount="10"/>
                      
        <pagerstyle backcolor="LightBlue"
          height="30px"
          verticalalign="Bottom"
          horizontalalign="Center"/>
                
      </asp:gridview>
            
      <!-- This example uses Microsoft SQL Server and connects
  -->
      <!-- to the Northwind sample database. Use an ASP.NET
     -->
      <!-- expression to retrieve the connection string
 value   -->
      <!-- from the Web.config file.                            -->
      <asp:sqldatasource id="CustomersSource"
        selectcommand="Select [CustomerID], [CompanyName], [Address],
 [City], [PostalCode], [Country] From [Customers]"
        connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>"
 
        runat="server"/>
        
    </form>
  </body>
</html>

<%@ Page language="C#" %>

<html>
  <body>
    <form runat="server">
        
      <h3>GridView AllowPaging Example</h3>

      <asp:gridview id="CustomersGridView" 
        datasourceid="CustomersSource" 
        autogeneratecolumns="true"
        emptydatatext="No data available." 
        allowpaging="true" 
        runat="server">
                
        <pagersettings mode="Numeric"
          position="Bottom"           
          pagebuttoncount="10"/>
                      
        <pagerstyle backcolor="LightBlue"
          height="30px"
          verticalalign="Bottom"
          horizontalalign="Center"/>
                
      </asp:gridview>
            
      <!-- This example uses Microsoft SQL Server and connects  -->
      <!-- to the Northwind sample database. Use an ASP.NET     -->
      <!-- expression to retrieve the connection string value
   -->
      <!-- from the Web.config file.                            -->
      <asp:sqldatasource id="CustomersSource"
        selectcommand="Select [CustomerID], [CompanyName], [Address], [City],
 [PostalCode], [Country] From [Customers]"
        connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>"
 
        runat="server"/>
        
    </form>
  </body>
</html>

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
GridView クラス
GridView メンバ
System.Web.UI.WebControls 名前空間
System.Web.UI.WebControls.PagerSettings
System.Web.UI.WebControls.TableItemStyle
PageCount
PageIndex
PagerSettings
PagerStyle
PagerTemplate
PageSize
PageIndexChanged
PageIndexChanging


このページでは「.NET Framework クラス ライブラリ リファレンス」からGridView.AllowPaging プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からGridView.AllowPaging プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からGridView.AllowPaging プロパティを検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「GridView.AllowPaging プロパティ」の関連用語

GridView.AllowPaging プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



GridView.AllowPaging プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS