你好如何解决这个问题?我试图在我的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();
}
}
答案 0 :(得分:0)
CopyToDataTable是一种方法,您需要将parenthesys添加到方法名称
dtChoice_2 = dtChoice.Select("QuestionID = '" + QNo + "'").CopyToDataTable();
^^^