i have a DataGridView and a list of objects that i would like to show.
The Objects are these:
public class Entity
{
public int ID { get; set; }
}
Your design is so strange. I have another approach is to override ToString() method of your classes (Service and City) like this:
public class Service: Entity
{
public string Name { get; set; }
public override string ToString(){
return Name;
}
}
public class City: Entity
{
public string Name { get; set; } // Max 50 chars
public override string ToString(){
return Name;
}
}
And that works OK. Again, your design is a little strange ^_^