GridView事件大全

时间:2011-10-17 06:43:36
【文件属性】:
文件名称:GridView事件大全
文件大小:39KB
文件格式:DOC
更新时间:2011-10-17 06:43:36
绑定分页排序全选删除选择项RowCommand事件 //RowCommand事件需要添加CommandArgument        protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)        {            LinkButton totop;            LinkButton tobottom;            if (e.Row.RowType == DataControlRowType.DataRow)            {                totop = (LinkButton)e.Row.FindControl("totop");                tobottom = (LinkButton)e.Row.FindControl("tobottom");                if (totop != null)                {                    if (totop.CommandName == "topstep")                        totop.CommandArgument = e.Row.RowIndex.ToString();                    if (tobottom.CommandName == "bottomstep")                        tobottom.CommandArgument = e.Row.RowIndex.ToString();                }            }        } }

网友评论