I'm currently learning to develop for the .net compact framework using c# in VS2008 and have a databinding query. The list binds fine in Form1_Load, however when I add additional people to the list they don't appear in dataGrid1 (although if I remove and re-add the binding they do appear). Is there something that I need to do after I add a person?
class Person
{
private string firstname;
private string surname;
public string FirstName { get { return firstname; } set { firstname = value; } }
public string Surname { get { return surname; } set { surname = value; } }
public Person(string F, string S)
{
this.firstname = F;
this.surname = S;
}
}
private void btnAdd_Click(object sender, EventArgs e)
{
people.Add(new Person(tbFirstName.Text, tbSurname.Text));
}
class People : List<Person>
{
}
People people = new People();
private void Form1_Load(object sender, EventArgs e)
{
people.Add(new Person("Jim", "Jones"));
people.Add(new Person("Al", "Hill"));
people.Add(new Person("Darth", "Vader"));
dataGrid1.DataSource = people;
}