DataGrids and Properties

Why in THE WORLD, must I have properties in my object in order to see them in a DataGrid?


For instance, if I create collection Wookies, each wookie better have a:

  private m_hairColor;

public string HairColor
{
get{return m_hairColor;}
set{m_hairColor = value;}
}

and not just
  public string HairColor;


or it will give you some error like “Wookies do not contain HairColor” when you try to display it in a DataGrid.


Look, I understand the niceties in creating properties, but sometimes, I don’t need to.


Also understand I am pissed off and didn’t feel like googling why.

Leave a Reply

Your email address will not be published. Required fields are marked *