如何读取rowbound中的特定行和列?如果我的gridview中有2个值,我想读取rowbound中的每行和每列
代码
protected void gvModal_RowDataBound(object sender, GridViewRowEventArgs e)
{
if(e.Row.RowType == DataControlRowType.DataRow)
{
string idd = gvModal.DataKeys[e.Row.RowIndex].Value.ToString();
string qa = "select Date_Issued, Quantity, Unit FROM Issuance_Consumables";
GridView gvDet = (GridView)e.Row.FindControl("gvIssuance");
gvDet.DataSource = GetData2(qa);
gvDet.DataBind();
}
}
DateIUssued,数量和单位将与" Model"," Company"等等来自字符串" idd"
答案 0 :(得分:0)
要实现这一目标,您需要获取相应的单元格值。
string value = e.Row.Cells [2] .Text;
您可以获得这样的值,然后继续。