Asp.net Radio Button List control


asp:RadioButtonList control

RadioButton List Control is a control that stores the radioboots, all one person <input type = radio> </ input>

RadioButton List Control is a control that groups a collection of radibutts, all are provided through an individual <input type = radio> </ input>. Its properties like backcroll, foreclosure, border collar, border style, borderwidth, height etc.

Following are some important properties that are very useful.
(RadioButtonList controls supports the same set of properties as the CheckBoxList control does.
SelectedValueGet the value first selected item.
SelectedIndexGets or Sets the index of the first selected item.
SelectedItemGets the first selected item
TextAlignGets or Sets the alignment of the radiobutton text.
DataTextFieldName of the data source field to supply the text of the items. (No need to set when you are adding items directly into .aspx page.)
DataValueFieldThe name of the data source field to supply the value of the items. (You do not need to set things when you are adding things directly to an .aspx page.)
DataSourceIDTo provide data, the ID of the data source component (only when you have a data source component on the page, such as SqlDataSource, AccessDataSource etc.)
DataSourceThe data source that populates items in the radiobotellist (usually when you dynamically produce objects from the database).
AutoPostBacktrue/false. If true, the form is automatically posted back to the server when user click any of the radiobutton. It will also fire OnSelectedIndexChanged method.
AppendDataBoundItemsright wrong. If true, fixed items added (added from .aspx page) are dynamically cleared (by the code behind the file) or items are cleaned.
OnSelectedIndexChangedMethod name that fires when user click any of the radiobutton in the list. (Fires only when AutoPostBack=true.)
ItemsGets the colleciton of the items from the list.
RepeatLayouttable/flow. Gets or Set the layout of the radiobuttons when rendered to the page.
RepeatColumnsGet or Sets the no. of columns to display when the control is rendered.
RepeatDirectionVertical horizontal To indicate whether the control will be presented horizontally or vertically, receives value or sets



1st RadioButton List
4th RadioButton List, This will fire OnSelectedIndexChanged event
2nd RadioButton List
3rd RadioButton List

// 1st RadioButtonList <asp:RadioButtonList ID="RadioButtonList1" runat="Server"> <asp:ListItem Text="Red" Value="red"></asp:ListItem> <asp:ListItem Text="Blue" Value="blue"></asp:ListItem> <asp:ListItem Text="Green" Value="green"></asp:ListItem> </asp:RadioButtonList> // 2nd RadioButtonList <asp:RadioButtonList ID="RadioButtonRunTime" runat="server" /> // 3rd RadioButtonList <asp:RadioButtonList ID="RadioButonListBind" runat="Server" DataTextField="Name" DataValueField="ID" /> // 4th RadioButtonList <asp:RadioButtonList ID="RadioButtonListBoundFire" runat="Server" DataTextField="Name" DataValueField="ID" OnSelectedIndexChanged="FireOnSelectedIndexChangd" AutoPostBack="true" />


Share on Google Plus

About It E Research

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment