RadioButtonList.CellPadding プロパティ

定義

テーブル セルの境界と内容との間隔 (ピクセル単位) を取得または設定します。

public:
 virtual property int CellPadding { int get(); void set(int value); };
[System.ComponentModel.Bindable(true)]
public virtual int CellPadding { get; set; }
public virtual int CellPadding { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.CellPadding : int with get, set
member this.CellPadding : int with get, set
Public Overridable Property CellPadding As Integer

プロパティ値

テーブル セルの境界と内容との間隔 (ピクセル単位)。 既定値は -1 です。このプロパティが設定されていないことを示します。

属性

次のコード例では、 プロパティを CellPadding 使用してコントロールの RadioButtonList セルを 10 ピクセルで埋める方法を示します。

<%@ Page Language="C#" AutoEventWireup="True" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>RadioButtonList.CellPadding Example</title>
</head>
<body>

<asp:RadioButtonList id="RadioButtonList1"
      CellPadding = "10"
      RepeatLayout="Table" 
      runat="server">
 
    <asp:ListItem>Item 1</asp:ListItem>
    <asp:ListItem>Item 2</asp:ListItem>
    <asp:ListItem>Item 3</asp:ListItem>
    <asp:ListItem>Item 4</asp:ListItem>
    <asp:ListItem>Item 5</asp:ListItem>
    <asp:ListItem>Item 6</asp:ListItem>
 
 </asp:RadioButtonList>
</body>
</html>
<%@ Page Language="VB" AutoEventWireup="True" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>RadioButtonList.CellPadding Example</title>
</head>
<body>

<asp:RadioButtonList id="RadioButtonList1"
      CellPadding = "10"
      RepeatLayout="Table" 
      runat="server">
 
    <asp:ListItem>Item 1</asp:ListItem>
    <asp:ListItem>Item 2</asp:ListItem>
    <asp:ListItem>Item 3</asp:ListItem>
    <asp:ListItem>Item 4</asp:ListItem>
    <asp:ListItem>Item 5</asp:ListItem>
    <asp:ListItem>Item 6</asp:ListItem>
 
 </asp:RadioButtonList>
</body>
</html>

注釈

このプロパティは、RepeatLayout プロパティが RepeatLayout.Table に設定されている場合にのみ適用されます。

セルの内容とセルの境界線の間隔を制御するには、このプロパティを使用します。

指定された埋め込み量は、セルの 4 つの辺すべてに追加されます。 テーブル内で最も高いセルの高さと、テーブル内で最も幅の広いセルの幅が使用されます。 結果のセル サイズは、テーブル内のすべてのセルに均一に適用されます。 個々のセル サイズを指定することはできません。

適用対象

こちらもご覧ください