RadioButtonList.CellPadding Property
Gets or sets the distance (in pixels) between the border and the contents of the table cell.
[Visual Basic] Public Overridable Property CellPadding As Integer [C#] public virtual int CellPadding {get; set;} [C++] public: __property virtual int get_CellPadding(); public: __property virtual void set_CellPadding(int); [JScript] public function get CellPadding() : int; public function set CellPadding(int);
Property Value
The distance (in pixels) between the border and the contents of the table cell. The default is -1, which indicates that this property is not set.
Remarks
This property only applies when the RepeatLayout property is set to RepeatLayout.Table.
Use this property to control the spacing between the contents of a cell and the cell's border.
The padding amount specified is added to all four sides of a cell. It uses the height of the tallest cell in the table and the width of the widest cell in the table. The resulting cell size is applied uniformly to all cells in the table. Individual cell sizes cannot be specified.
Example
[Visual Basic, C#, JScript] The following example demonstrates how to use the CellPadding property to pad the cells of a RadioButtonList with 10 pixels.
[Visual Basic] <%@ Page Language="VB" AutoEventWireup="True" %> <asp:RadioButtonList id=RadioButtonList1 CellPadding = "10" 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> [C#] <%@ Page Language="C#" AutoEventWireup="True" %> <asp:RadioButtonList id=RadioButtonList1 CellPadding = "10" 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> [JScript] <%@ Page Language="JScript" AutoEventWireup="True" %> <asp:RadioButtonList id=RadioButtonList1 CellPadding = "10" 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>
[C++] No example is available for C++. To view a Visual Basic, C#, or JScript example, click the Language Filter button
in the upper-left corner of the page.
Requirements
Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family
See Also
RadioButtonList Class | RadioButtonList Members | System.Web.UI.WebControls Namespace | CellSpacing