嗨如何解决这个问题?我试图在我的 rowdatabound 事件中执行此操作
protected void RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgse)
{
if (e.Row.RowType == DataControlRowType.DataRow) {
//If str = "0" Then
string QNo = "";
QNo = e.Row.Cells[0].Text;
DataTable dtChoice_2;
dtChoice_2 = dtChoice_2.Select("QuestionID = '" + QNo + "'").CopyToDataTable;
RadioButtonList RadioBtnList = (RadioButtonList)e.Row.FindControl("RdChoices");
RadioBtnList.DataSource = dtChoice_2;
RadioBtnList.DataValueField = "ChoiceID";
RadioBtnList.DataTextField = "ChoiceDescription";
RadioBtnList.DataBind();
}
}