GridView模板列有一TextBox,TextBox的AutoPostBack属性为True,在TextChanged事件中可通过如下代码获取当前行某列的值:
Code
protected void number_TextChanged(object sender, EventArgs e)
{
TextBox t = (TextBox)sender;
GridViewRow drv = (GridViewRow)t.NamingContainer;
int rowIndex = drv.RowIndex;
string coid = ((Label)gdvList.Rows[drv.RowIndex].FindControl("lblCoId")).Text;
}