I have two textboxes. One for e-mail and the other for remarks. When the user clicks the add button, it should be adding to my datagrid, but to no avail! How can I do this? As the user clicks on the add button, he has to increase the rows of the datagrid
Note: I use WPF
I'm tempting this way:
public class Email{
public string email { get; set; }
public string obs { get; set; }
}
for (int i=0; i < 10; i++){
List<Email> lista = new List<Email>();
Email em = new Email();
em.email = textEmpEmail.Text;
em.obs = textEmpObs1.Text;
lista.Add(em);
dataGridEmails.ItemsSource = lista;
}
In this way, it inserts 10 at a time ... But I needed that added per click, one at a time ..
Thank you!