GridView.CaptionAlign プロパティ
アセンブリ: System.Web (system.web.dll 内)

Dim instance As GridView Dim value As TableCaptionAlign value = instance.CaptionAlign instance.CaptionAlign = value
public: virtual property TableCaptionAlign CaptionAlign { TableCaptionAlign get (); void set (TableCaptionAlign value); }
/** @property */ public TableCaptionAlign get_CaptionAlign () /** @property */ public void set_CaptionAlign (TableCaptionAlign value)
public function get CaptionAlign () : TableCaptionAlign public function set CaptionAlign (value : TableCaptionAlign)
TableCaptionAlign 値の 1 つ。既定値は TableCaptionAlign.NotSet で、ブラウザの既定の設定が使用されます。


CaptionAlign プロパティを使用して、GridView コントロールの HTML キャプション要素の水平位置または垂直位置を指定します。このプロパティは、補助技術デバイスのユーザーがコントロールをより使いやすくするために用意されています。
このプロパティは、TableCaptionAlign 列挙値の 1 つを使用して設定します。有効値の一覧を次の表に示します。
値 | |
---|---|
TableCaptionAlign.Bottom | |
TableCaptionAlign.Left | |
TableCaptionAlign.NotSet | |
TableCaptionAlign.Right | |
TableCaptionAlign.Top |

CaptionAlign プロパティを使用して、GridView コントロールのキャプション要素がコントロールの上部に揃えて配置されるように指定する方法を次のコード例に示します。
<%@ Page language="VB" %> <html> <body> <form runat="server"> <h3>GridView Caption and CaptionAlign Example</h3> <asp:gridview id="CustomersGridView" datasourceid="CustomersSource" autogeneratecolumns="true" emptydatatext="No data available." allowpaging="true" caption="Customer Information Table" captionalign="Top" runat="server"> </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 Caption and CaptionAlign Example</h3> <asp:gridview id="CustomersGridView" datasourceid="CustomersSource" autogeneratecolumns="true" emptydatatext="No data available." allowpaging="true" caption="Customer Information Table" captionalign="Top" runat="server"> </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>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からGridView.CaptionAlign プロパティを検索する場合は、下記のリンクをクリックしてください。

- GridView.CaptionAlign プロパティのページへのリンク