Hi ,
Check this
First Tag your question winforms
List<Song> songs;
private void Form1_Load(object sender, EventArgs e)
{
songs = new List<Song>
{
new Song() {Name = "song1"},
new Song() {Name = "song2"},
new Song() {Name = "song3"}
};
dataGridView1.DataSource = songs;
}
int i = 4;
private void button1_Click(object sender, EventArgs e)
{
songs.Add(new Song() { Name = "song"+i });
dataGridView1.DataSource = null;
dataGridView1.DataSource = songs;
i++;
}
}
}
class Song
{
public string Name { get; set; }
}
Best Regards
M.Mitwalli