private void dgBulletin_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
//根据带有四个备选答案的RadioButtonList
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
DataRowView drv = (DataRowView)e.Item.DataItem;
RadioButtonList rblTemp = (RadioButtonList)e.Item.FindControl("rblAnswer");
rblTemp.Items.Add(new ListItem(drv["ST_Answer1"].ToString(),"A"));
rblTemp.Items.Add(new ListItem(drv["ST_Answer2"].ToString(),"B"));
rblTemp.Items.Add(new ListItem(drv["ST_Answer3"].ToString(),"C"));
rblTemp.Items.Add(new ListItem(drv["ST_Answer4"].ToString(),"D"));
}
}
考试系统中单选列表的实现
最新推荐文章于 2021-12-03 11:20:42 发布