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

[LocalizableAttribute(true)] public: virtual property String^ Caption { String^ get (); void set (String^ value); }
/** @property */ public String get_Caption () /** @property */ public void set_Caption (String value)
GridView コントロールの HTML キャプション要素に表示されるテキストを表す文字列。既定値は空の文字列 ("") です。

GridView コントロールの HTML キャプション要素に表示するテキストを指定するには、Caption プロパティを使用します。指定したテキストは、補助技術デバイスに、このコントロールをより使いやすくするための説明を提供します。CaptionAlign プロパティを使用して、HTML のキャプション要素を表示する位置を指定することもできます。
このプロパティの値は、設定時に、デザイナ ツールを使用してリソース ファイルに自動的に保存できます。詳細については、LocalizableAttribute、ASP.NET のグローバリゼーションおよびローカリゼーション の各トピックを参照してください。

Caption プロパティを使用して、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.Caption プロパティを検索する場合は、下記のリンクをクリックしてください。

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