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

Dim instance As DetailsView Dim value As HorizontalAlign value = instance.HorizontalAlign instance.HorizontalAlign = value
public: virtual property HorizontalAlign HorizontalAlign { HorizontalAlign get (); void set (HorizontalAlign value); }
/** @property */ public HorizontalAlign get_HorizontalAlign () /** @property */ public void set_HorizontalAlign (HorizontalAlign value)
public function get HorizontalAlign () : HorizontalAlign public function set HorizontalAlign (value : HorizontalAlign)
HorizontalAlign 値の 1 つ。既定値は HorizontalAlign.NotSet です。

HorizontalAlign プロパティを使用して、ページ内の DetailsView コントロールの水平方向の配置を指定します。さまざまな水平方向の配置の一覧を次の表に示します。
HorizontalAlign の値 | |
---|---|
HorizontalAlign.NotSet | |
HorizontalAlign.Left | |
HorizontalAlign.Center | |
HorizontalAlign.Right | |
HorizontalAlign.Justify |

HorizontalAlign プロパティを使用して、DetailsView コントロールがページ上に中央揃えで表示されるように指定する方法のコード例を次に示します。
<%@ Page language="VB" %> <html> <body> <form id="Form1" runat="server"> <h3>DetailsView HorizontalAlign Example</h3> <asp:detailsview id="CustomerDetailView" datasourceid="DetailsViewSource" autogeneraterows="true" allowpaging="true" horizontalalign="Center" runat="server"> <fieldheaderstyle 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 HorizontalAlign Example</h3> <asp:detailsview id="CustomerDetailView" datasourceid="DetailsViewSource" autogeneraterows="true" allowpaging="true" horizontalalign="Center" runat="server"> <fieldheaderstyle 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.HorizontalAlign プロパティを検索する場合は、下記のリンクをクリックしてください。

- DetailsView.HorizontalAlign プロパティのページへのリンク