Datagridview shows classname instead of property
I'm trying to put data in a datagridview by putting a List
http://i.imgur.com/Cw6LY.png
Is there a way I can do this? I don't really know what to search for..
Just override ToString
to show what you need.
Unless you want editing, which will require more effort.
Update:
A simple solution (if you do not have 10's or 100's of these) is to create a proxy class.
Example:
class FooProxy
{
Foo bar; // internal object
public string Baz
{
get {return bar.Baz; }
set { bar.Baz = value }
}
public bool Oink
{
get {return bar.Oink.Enabled; }
set {bar.Oink.Enabled = value; }
}
}
精彩评论