我对将 BoundFiled 添加到 GridView 有疑问。关于框架 .net 2,更高是不可能的。我有这个代码
BoundField column = new BoundField();
column.HeaderText = "XX";
column.DataField = "ID";
column.SortExpression = "ID";
column.HeaderStyle.CssClass = "titletext";
column.ItemStyle.Width = Unit.Percentage(7);
TableCell tc = new TableCell();
tc.Controls.Add(column);
最后一个命令返回此错误消息
“'System.Web.UI.ControlCollection.Add(System.Web.UI.Control)' 的最佳重载方法匹配有一些无效参数”
这就是我在 c# 中使用的
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
此示例来自互联网,无法正常工作,感谢帮助。