gridview小把戏

点击任意行触发事件

protected void GridView1_Load(object sender, EventArgs e)
    {
        for (int i = 0; i < this.GridView1.Rows.Count; i++)
        {
            string ok = this.GridView1.Rows[i].Cells[0].Text;
            this.GridView1.Rows[i].Attributes.Add("onclick", "javascript:alert('" + ok + "');");
        }
    }

posted on 2008-06-19 14:07  小黑混北京  阅读(185)  评论(0编辑  收藏  举报