private void btnAdd_Click(object sender, EventArgs e) { DataRow row = dt.NewRow(); row[0] = dt.Rows.Count; row[1] = " 新增,TTTT" + this.panelEx1.Count; row[2] = DateTime.Now.AddDays(-30).ToString("yyyy-MM-dd HH:mm"); row[3] = "超级管理员"; dt.Rows.Add(row); ReplyModel item = new ReplyModel(); item.DataRow = row; this.panelEx1.Add(item); }
void btnInsert_Click(object sender, EventArgs e) { DataRow row = dt.NewRow(); row[0] = dt.Rows.Count; row[1] = " 插入 TTTTTT 生日,TTTT敬请关注" + this.panelEx1.Count; row[2] = DateTime.Now.AddDays(-30).ToString("yyyy-MM-dd HH:mm"); row[3] = "超级管理员"; dt.Rows.Add(row); ReplyModel item = new ReplyModel(); item.DataRow = row; this.panelEx1.Insert(int.Parse(txtInsertRowIndex.Text), item); }