The following code snippet shows how you can bind data to this control with data
from an external data source:
protected void Page_Load(Object sender, EventArgs e)
{
if (!IsPostBack)
{
DataManager dataManager = new DataManager();
bulletedList.DataSource = dataManager.GetDataFromArrayList();
bulletedList.DataTextField="EmpName";
bulletedList.DataValueField="EmpCode";
bulletedList.DataBind();
}
}
??? ???
Working with List Controls in ASP.NET
[ 58 ]
Handling BulletedList Control Events
The SelectedIndexChanged event of the ???ulletedList control is fired whenever you
click on any list item in the control. The following code snippet shows how you can
use this event in your applications.
private void bulletedList_SelectedIndexChanged(object sender,
System.EventArgs e)
{
//Usual code to handle the event
}
Working with the RadioButtonList Control
The RadioButtonList control in ASP.NET is used to display a collection of radio
buttons that provide the user a multiple set of choices to choose from. You can
select any one of the radio buttons from this list of radio buttons. You can bind data
statically or programmatically to this control. The SelectedItem property of this
control can be used to retrieve the radio button that has been selected.
Appending List Items to the RadioButtonList
Control
The following figure displays the Radio???uttonList control bound with data.
Pages:
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73