这要动态给某列添加JS代码
在RowDataBound的事件里
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.e.Row.Cells[列索引].Attributes.Add("焦点事件名", "操作");
}
在RowDataBound的事件里
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.e.Row.Cells[列索引].Attributes.Add("焦点事件名", "操作");
}
判断列号是否相同,并记录新的列号