gridview在后台动态添加boundfield并绑定数据,这样怎么不行啊??急急!!!
回复hahadic:gridview的databoundfield事件中if(e.Row.RowType==DataControlRowType.DataRow)&nbs...
回复hahadic:gridview的databoundfield事件中if (e.Row.RowType == DataControlRowType.DataRow) { int count = 0; if (Session["tjcount"] != null) { count = Convert.ToInt32(Session["tjcount"]); } BoundField field=null; BoundField field1=null; for (int j = 1; j <= count; j++) { field = new BoundField(); field.DataField = "第" + j + "次调价"; field.ItemStyle.CssClass = "class1"; this.gvlzjg.Columns.Add(field); field1 = new BoundField(); field1.DataField = "第" + j + "次调价"; field1.ItemStyle.CssClass = "class1"; this.gvlzjg.Columns.Add(field1); } }这样写为什么不能绑上数据
展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询