I have Form with DataGridView and Button. DataGridView shows data from ArrayList, and I want to add elements to ArrayList by DataGridView. So, I’m trying this:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
dataGridView1.DataSource = Student.students;
}
private void button1_Click(object sender, EventArgs e)
{
Student st = new Student();
Student.students.Add(st);
}
}
But this doesn’t work… How can I add new row to this DataGridView? Thanks.