见附件例子!
List<Student> students = new List<Student>();
public Form1()
{
InitializeComponent();
c1FlexGrid1.DataSource = students;
}
private void btnAddNew_Click(object sender, EventArgs e)
{
students.Add(new Student { Name = "张三", Gender = "男", Age = 18 });
students.Add(new Student { Name = "李四", Gender = "女", Age = 17 });
c1FlexGrid1.Refresh();
}
|