DetailsView.CaptionAlign プロパティ
アセンブリ: System.Web (system.web.dll 内)
構文Dim instance As DetailsView 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 プロパティを使用して、DetailsView コントロールの HTML キャプション要素の水平位置または垂直位置を指定します。このプロパティは、補助技術デバイスのユーザーがコントロールをより使いやすくするために用意されています。
このプロパティは、TableCaptionAlign 列挙値の 1 つを使用して設定します。有効値の一覧を次の表に示します。
|   値  |  |
|---|---|
|   TableCaptionAlign.Bottom  |  |
|   TableCaptionAlign.Left  |  |
|   TableCaptionAlign.NotSet  |  |
|   TableCaptionAlign.Right  |  |
|   TableCaptionAlign.Top  |  
Caption プロパティによって、DetailsView コントロールにユーザー補助サポートが追加されます。DetailsView コントロールの HTML キャプション要素に表示するテキストを指定するには、Caption プロパティを使用します。
使用例CaptionAlign プロパティを使用して、DetailsView コントロールの HTML キャプション要素がコントロールの左側に表示されるように指定する方法のコード例を次に示します。
<%@ Page language="VB" %> <html> <body> <form id="Form1" runat="server"> <h3>DetailsView Caption and CaptionAlign Example</h3> <asp:detailsview id="CustomerDetailView" datasourceid="DetailsViewSource" datakeynames="CustomerID" autogeneraterows="true" allowpaging="true" caption="Customer Details" captionalign="Left" runat="server"> <headerstyle backcolor="Navy" forecolor="White"/> </asp:detailsview> <!-- 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="DetailsViewSource" runat="server" ConnectionString= "<%$ ConnectionStrings:NorthWindConnectionString%>" InsertCommand="INSERT INTO [Customers]([CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country]) VALUES (@CustomerID, @CompanyName, @Address, @City, @PostalCode, @Country)" SelectCommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]"> </asp:SqlDataSource> </form> </body> </html>
<%@ Page language="C#" %> <html> <body> <form id="Form1" runat="server"> <h3>DetailsView Caption and CaptionAlign Example</h3> <asp:detailsview id="CustomerDetailView" datasourceid="DetailsViewSource" datakeynames="CustomerID" autogeneraterows="true" allowpaging="true" caption="Customer Details" captionalign="Left" runat="server"> <headerstyle backcolor="Navy" forecolor="White"/> </asp:detailsview> <!-- 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="DetailsViewSource" runat="server" ConnectionString= "<%$ ConnectionStrings:NorthWindConnectionString%>" InsertCommand="INSERT INTO [Customers]([CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country]) VALUES (@CustomerID, @CompanyName, @Address, @City, @PostalCode, @Country)" SelectCommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]"> </asp:SqlDataSource> </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に収録されているすべての辞書からDetailsView.CaptionAlign プロパティを検索する場合は、下記のリンクをクリックしてください。
                     全ての辞書からDetailsView.CaptionAlign プロパティ
                    を検索
                - DetailsView.CaptionAlign プロパティのページへのリンク