日期:2014-05-17 浏览次数:20542 次
{ protected void Page_Load(object sender, EventArgs e) { List<Info> list = new List<Info>(); list.Add(new Info("11","22")); list.Add(new Info("111","222")); this.GridView1.DataSource = list; // 表格将显示这个类数组的内容。。。 this.GridView1.DataBind(); } } public class Info { private string m_s1 = ""; private string m_s2 = ""; public Info(string s11, string s22) { this.m_s1 = s11; this.m_s2 = s22; } public string S2 { get { return m_s2; } set { m_s2 = value; } } public string S1 { get { return m_s1; } set { m_s1 = value; } } }