How to bind a collection of objects to a DataGridView in Winforms
问题 If i have two objects, namely Fruit' and Color` and their definitions are as follows: public class Fruit { public int FruitId { get; set; } public string Name { get; set; } public Color Color { get; set; } } public class Color { public int ColorId { get; set; } public string Name { get; set; } } How do I bind a collection of Fruit (e.g. List<Fruit>) to a DataGridView? where the resulting output would be something similar to the following: +-----+--------+----------+ | Id | Name | Color | +---