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

Public Overridable Property CellPadding As Integer
Dim instance As GridView 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 側面のすべてに追加されます。
GridView コントロールの同じ列内のセルの幅はすべて同じになります。間隔は最大幅のセルに適用され、列内の他のセルもすべてこのセルの幅に設定されます。同様に、同じ行内のすべてのセルの高さは同じになります。間隔は最も高いセルに適用され、行内の他のセルもすべてこのセルの高さに設定されます。それぞれのセルのサイズを指定することはできません。

CellPadding プロパティを使用して、セルの内容とセルの境界線との間の間隔を宣言によって設定する方法を次のコード例に示します。
<%@ Page language="VB" %> <html> <body> <form runat="server"> <h3>GridView CellPadding and CellSpacing Example</h3> <asp:gridview id="CustomersGridView" datasourceid="CustomersSource" autogeneratecolumns="true" emptydatatext="No data available." cellpadding="10" cellspacing="5" 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 CellPadding and CellSpacing Example</h3> <asp:gridview id="CustomersGridView" datasourceid="CustomersSource" autogeneratecolumns="true" emptydatatext="No data available." cellpadding="10" cellspacing="5" 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.CellPadding プロパティを検索する場合は、下記のリンクをクリックしてください。

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