The question is asked with respect to an Object DataSource. So Consider that I have a class
public class Customer{
public String name;
public int age;
public Customer(String name, int age) {
this.name = name;
this.age = age;
}
}
And I have databound a list box to a list of these objects. So I say
listBox.DisplayMember = "name";
But my question is that when I refactor my Customer class's name to
public String fullName;
the DisplayMember still stays at "name". This will fail. So it decreases my ability to refactor domain objects. Is there any way around for this?