RadioButtonList.CellPadding Właściwość

Definicja

Pobiera lub ustawia odległość (w pikselach) między obramowaniem a zawartością komórki tabeli.

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

Wartość właściwości

Int32

Odległość (w pikselach) między obramowaniem a zawartością komórki tabeli. Wartość domyślna to -1, która wskazuje, że ta właściwość nie jest ustawiona.

Atrybuty

Przykłady

W poniższym przykładzie kodu pokazano, jak używać CellPadding właściwości do wypełniania komórek kontrolki RadioButtonList o 10 pikselach.

<%@ 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>

Uwagi

Ta właściwość ma zastosowanie tylko wtedy, gdy właściwość jest ustawiona RepeatLayout na RepeatLayout.Table.

Użyj tej właściwości, aby kontrolować odstępy między zawartością komórki a obramowaniem komórki.

Określona kwota dopełniania jest dodawana do wszystkich czterech stron komórki. Używa ona wysokości najwyższej komórki w tabeli i szerokości najszerszej komórki w tabeli. Wynikowy rozmiar komórki jest stosowany jednolicie do wszystkich komórek w tabeli. Nie można określić pojedynczych rozmiarów komórek.

Dotyczy

Zobacz też