猿问

Gridview行命令单元格转换为公共字符串

我有一个带有rowcommand事件的gridview。


我希望temp在rowcommand之外使用string的值。这可能吗?


protected void gwActivity_RowCommand(object sender, GridViewCommandEventArgs e)

{

   GridViewRow row = ((e.CommandSource as Control).NamingContainer as GridViewRow);

   string temp = row.Cells[1].Text;  

}


ibeautiful
浏览 136回答 1
1回答
随时随地看视频慕课网APP
我要回答