日期:2014-05-18 浏览次数:20572 次
if (e.Item.ItemType == ListItemType.Item ||
e.Item.ItemType == ListItemType.AlternatingItem)
{
Question qst = (Question)e.Item.DataItem;
{
RadioButtonList rblst = (RadioButtonList)e.Item.FindControl("rblst");
CheckBoxList chklst = (CheckBoxList)e.Item.FindControl("chklst");
ListControl lc = null;
if (qst.Typeid == 1)
{
if (e.Item.ItemIndex=0)
{
HtmlTableRow r = new HtmlTableRow();
HtmlTableCell c = new HtmlTableCell();
c.Controls.Add(new LiteralControl("单选题"));
r.Cells.Add(c);
e.Item.Controls.AddAt(0,r);
}
lc = rblst;
chklst.Visible = false;
}
else
{
Question qst2= (Question) rptTitle.Items[e.Item.ItemIndex-1].DataItem;
if (qst.Typeid !=qst2.Typeid)
{
HtmlTableRow r = new HtmlTableRow();
HtmlTableCell c = new HtmlTableCell();
c.Controls.Add(new LiteralControl("多选题"));
r.Cells.Add(c);
e.Item.Controls.AddAt(0,r);
}
lc = chklst;
rblst.Visible = false;
}
}
}