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

Public Overridable Property CellPadding As Integer
Dim instance As DetailsView Dim value As Integer value = instance.CellPadding instance.CellPadding = value
/** @property */ public int get_CellPadding () /** @property */ public void set_CellPadding (int value)
セルの内容とセルの境界線の間の間隔 (ピクセル単位)。既定値は -1 です。このプロパティが設定されていないことを示します。

CellPadding プロパティを使用して、セルの内容とセルの境界線の間の間隔を制御します。指定した余白の量は、セルの 4 側面のすべてに追加されます。
DetailsView コントロールの同じ列内のセルの幅はすべて同じになります。間隔は最大幅のセルに適用され、列内の他のセルもすべてこのセルの幅に合わせて調整されます。同様に、同じ行内のすべてのセルの高さは同じになります。間隔は最も高いセルに適用され、行内の他のセルもすべてこのセルの高さに合わせて調整されます。それぞれのセルのサイズを指定することはできません。

CellPadding プロパティを使用して、セルの内容とセルの境界線との間の間隔を指定する方法のコード例を次に示します。
<%@ Page language="VB" %> <html> <body> <form id="Form1" runat="server"> <h3>DetailsView CellPadding and CellSpacing Example</h3> <asp:detailsview id="CustomerDetailView" datasourceid="DetailsViewSource" datakeynames="CustomerID" autogeneraterows="true" allowpaging="true" cellpadding="10" cellspacing="5" 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 CellPadding and CellSpacing Example</h3> <asp:detailsview id="CustomerDetailView" datasourceid="DetailsViewSource" datakeynames="CustomerID" autogeneraterows="true" allowpaging="true" cellpadding="10" cellspacing="5" 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.CellPadding プロパティを検索する場合は、下記のリンクをクリックしてください。

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