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

Public Overridable Property CellSpacing As Integer
Dim instance As DetailsView Dim value As Integer value = instance.CellSpacing instance.CellSpacing = value
/** @property */ public int get_CellSpacing () /** @property */ public void set_CellSpacing (int value)
セル間の間隔 (ピクセル単位)。既定値は、0 です。

CellSpacing プロパティを使用して、DetailsView コントロール内の隣接するセル間の間隔を制御します。この間隔は垂直方向と水平方向の両方に適用されます。セルの間隔は、コントロール全体で統一されています。行または列間のセルの間隔は個別に指定できません。
![]() |
---|
このプロパティに 0 よりも大きい値を設定し、GridLines プロパティをセルの境界線を表示する値に設定すると、隣接するセルの境界線の間にギャップが表示されます。このような場合は、CellSpacing プロパティによってギャップのサイズが制御されます。 |

CellSpacing プロパティを使用して、隣接するセル間の間隔を指定する方法のコード例を次に示します。
<%@ 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.CellSpacing プロパティを検索する場合は、下記のリンクをクリックしてください。

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