using System; using System.Data; using System.Data.SqlClient; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class Demo18 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { BindData(); } } public void BindData() { string strSql = "select UserID,C_Name,E_Name,UpdataDate,isDY from Demo_User "; DataTable dt = SqlHelper.ExecuteDataset(SqlHelper.CONN_STRING, CommandType.Text, strSql, null).Tables[0]; GridView.DataSource = dt; GridView.DataKeyNames = new string[] { "UserID" };//主键 GridView.DataBind(); } protected void GridView_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView.PageIndex = e.NewPageIndex; BindData(); } protected void Button1_Click(object sender, EventArgs e) { CheckBoxAll.Checked = false; CheckBox1.Checked = false; for (int i = 0; i GridView演示
登录后复制
更多asp.net GridView控件中模板列CheckBox全选、反选、取消相关文章请关注PHP中文网!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至253000106@qq.com举报,一经查实,本站将立刻删除。
发布者:PHP中文网,转转请注明出处:https://www.chuangxiangniao.com/p/2552933.html