摘要:
protected void gvTest_RowDataBound(object sender, GridViewRowEventArgs e) { //如果是绑定数据行 if (e.Row.RowType == DataControlRowType.DataRow) { //鼠标经过时,行背景色变 e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#E6F5FA'"); //鼠标移出时,行背景色变 e.Row.Attributes.Add("on 阅读全文
摘要:
gridview编辑列,把左下角的"自动生成字段"的复选框的勾去掉添加boundfield(绑定列)将其datafield设置为productname,headertext设置为"产品名"再添加commadfield下的编辑,更新,取消确定.cs文件按中编写一绑定gridview数据的方法:public void bind() { SqlConnection conn = new SqlConnection("server=.;uid=sa;pwd=;database=Northwind"); conn.Open(); SqlData 阅读全文