FormView.PagerStyle プロパティ

定義

TableItemStyle コントロールのページ行の外観を設定できる FormView オブジェクトへの参照を取得します。

public:
 property System::Web::UI::WebControls::TableItemStyle ^ PagerStyle { System::Web::UI::WebControls::TableItemStyle ^ get(); };
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public System.Web.UI.WebControls.TableItemStyle PagerStyle { get; }
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
member this.PagerStyle : System.Web.UI.WebControls.TableItemStyle
Public ReadOnly Property PagerStyle As TableItemStyle

プロパティ値

TableItemStyle

TableItemStyle コントロールのページ行のスタイルを表す FormView への参照。

属性

次の例では、プロパティを使用 PagerStyle してページャー行のスタイル設定を指定する方法を示します。


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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>FormView AllowPaging Example</title>
</head>
<body>
    <form id="form1" runat="server">
        
      <h3>FormView AllowPaging Example</h3>
                       
      <asp:formview id="EmployeeFormView"
        datasourceid="EmployeeSource"
        allowpaging="true"
        datakeynames="EmployeeID" 
        runat="server">
        
        <pagersettings mode="Numeric"
          position="Bottom"/>
          
        <pagerstyle backcolor="LightBlue"
          horizontalalign="Center"/>
        
        <itemtemplate>
        
          <table>
            <tr>
              <td>
                <asp:image id="EmployeeImage"
                  imageurl='<%# Eval("PhotoPath") %>'
                  alternatetext='<%# Eval("LastName") %>' 
                  runat="server"/>
              </td>
              <td>
                <h3><%# Eval("FirstName") %> <%# Eval("LastName") %></h3>      
                <%# Eval("Title") %>        
              </td>
            </tr>
          </table>
        
        </itemtemplate> 
                  
      </asp:formview>
          
      <!-- 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="EmployeeSource"
        selectcommand="Select [EmployeeID], [LastName], [FirstName], [Title], [PhotoPath] From [Employees]"
        connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>" 
        runat="server"/>
            
    </form>
  </body>
</html>

<%@ Page language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>FormView AllowPaging Example</title>
</head>
<body>
    <form id="form1" runat="server">
        
      <h3>FormView AllowPaging Example</h3>
                       
      <asp:formview id="EmployeeFormView"
        datasourceid="EmployeeSource"
        allowpaging="true"
        datakeynames="EmployeeID" 
        runat="server">
        
        <pagersettings mode="Numeric"
          position="Bottom"/>
          
        <pagerstyle backcolor="LightBlue"
          horizontalalign="Center"/>
        
        <itemtemplate>
        
          <table>
            <tr>
              <td>
                <asp:image id="EmployeeImage"
                  imageurl='<%# Eval("PhotoPath") %>'
                  alternatetext='<%# Eval("LastName") %>' 
                  runat="server"/>
              </td>
              <td>
                <h3><%# Eval("FirstName") %> <%# Eval("LastName") %></h3>      
                <%# Eval("Title") %>        
              </td>
            </tr>
          </table>
        
        </itemtemplate> 
                  
      </asp:formview>
          
      <!-- 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="EmployeeSource"
        selectcommand="Select [EmployeeID], [LastName], [FirstName], [Title], [PhotoPath] From [Employees]"
        connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>" 
        runat="server"/>
            
    </form>
  </body>
</html>

注釈

このプロパティを PagerStyle 使用して、コントロール内のポケットベル行の外観を FormView 制御します。 ページング機能が有効な場合 (プロパティが設定trueされている場合AllowPaging)、ページャーの行が表示され、ユーザーがコントロール内の別のページに移動できるコントロールが含まれます。 このプロパティは読み取り専用です。ただし、返されるオブジェクトのプロパティを TableItemStyle 設定できます。 プロパティは、次のいずれかの方法を使用して宣言によって設定できます。

  • フォーム内のコントロールの開始タグに属性をFormViewProperty-Subproperty配置します。これはSubpropertyオブジェクトのTableItemStyleプロパティです (たとえば)。 PagerStyle-ForeColor

  • コントロールの <PagerRowStyle> 開始タグと終了タグの間に要素を FormView 入れ子にします。

プロパティは、プログラムでフォーム Property.Subproperty (たとえば PagerStyle.ForeColor) で設定することもできます。 一般的な設定には、通常、カスタム背景色、前景色、フォント プロパティが含まれます。

適用対象

こちらもご覧ください