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

Public Overridable Property CellPadding As Integer
Dim instance As FormView 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 側面のすべてに追加されます。
FormView コントロールの同じ列内のセルの幅はすべて同じになります。間隔は最大幅のセルに適用され、列内の他のセルもすべてこのセルの幅に合わせて調整されます。同様に、同じ行内のすべてのセルの高さは同じになります。間隔は最も高いセルに適用され、行内の他のセルもすべてこのセルの高さに合わせて調整されます。それぞれのセルのサイズを指定することはできません。
セル間の間隔を調整するには、CellSpacing プロパティを使用します。
![]() |
---|

CellPadding プロパティを使用して、セルの内容とセルの境界線との間の間隔を指定する方法を次の例に示します。
<%@ Page language="VB" %> <html> <body> <form runat="server"> <h3>FormView Example</h3> <asp:formview id="EmployeeFormView" datasourceid="EmployeeSource" allowpaging="true" datakeynames="EmployeeID" cellpadding="10" cellspacing="20" gridlines="Both" runat="server"> <itemtemplate> <table> <tr> <td> <asp:image id="EmployeeImage" imageurl='<%# Eval("PhotoPath") %>' alternatetext='<%# Eval("LastName") %>' runat="server"/> </td> <td> <h3><%# Eval("FirstName") %> <%# Eval("LastName") %></h3> <%# Eval("Title") %> </td> </tr> </table> </itemtemplate> <pagersettings position="Bottom" mode="NextPrevious"/> </asp:formview> <!-- 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="EmployeeSource" selectcommand="Select [EmployeeID], [LastName], [FirstName], [Title], [PhotoPath] From [Employees]" connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>" runat="server"/> </form> </body> </html>
<%@ Page language="C#" %> <html> <body> <form runat="server"> <h3>FormView Example</h3> <asp:formview id="EmployeeFormView" datasourceid="EmployeeSource" allowpaging="true" datakeynames="EmployeeID" cellpadding="10" cellspacing="20" gridlines="Both" runat="server"> <itemtemplate> <table> <tr> <td> <asp:image id="EmployeeImage" imageurl='<%# Eval("PhotoPath") %>' alternatetext='<%# Eval("LastName") %>' runat="server"/> </td> <td> <h3><%# Eval("FirstName") %> <%# Eval("LastName") %></h3> <%# Eval("Title") %> </td> </tr> </table> </itemtemplate> <pagersettings position="Bottom" mode="NextPrevious"/> </asp:formview> <!-- 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="EmployeeSource" selectcommand="Select [EmployeeID], [LastName], [FirstName], [Title], [PhotoPath] From [Employees]" 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に収録されているすべての辞書からFormView.CellPadding プロパティを検索する場合は、下記のリンクをクリックしてください。

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