我想将数组字符串分配给数据行数组
我的代码如下
protected void btnGenerate_Click(object sender, EventArgs e)
{
DataRow[] dRow;
foreach (GridViewRow grRow in grdACH.Rows)
{
CheckBox chkItem = (CheckBox)grRow.FindControl("checkRec");
if (chkItem.Checked)
{
chkItm = true;
chkcnt++;
strBankTypeID += ((Label)grRow.FindControl("lblBankType")).Text.ToString();
strBnkArray = strBankTypeID.Split(',');
foreach (string str in strBnkArray)
{
//Here i have to assign my string of array to datarow
}
}
}
}
任何人都可以帮助我
答案 0 :(得分:1)
您需要设置GridViewRow.DataItem
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridviewrow.dataitem.aspx