Binding an Ilist to datagridview containing another object in a field
Posted
by JaSk
on Stack Overflow
See other posts from Stack Overflow
or by JaSk
Published on 2010-04-08T18:48:27Z
Indexed on
2010/04/08
18:53 UTC
Read the original article
Hit count: 244
I have pretty much the same problem as this question http://stackoverflow.com/questions/970741 but in windows forms, can anyone help me solve it? this is my code, so you don't have to check the other question: public class Material { public virtual int id { get; private set; } public virtual string nombre { get; set; } public virtual string unidad { get; set; } public virtual Categorias Categoria { get; set; } public virtual IList Materiales { get; set; }
public Material()
{
Materiales = new List<Materiales>();
}
public virtual void AddMateriales(Materiales materiales)
{
materiales.Material = this;
this.Materiales.Add(materiales);
}
}
as you can see I have an object within the IList so when I use the List as the data source for a datagridview I get a object.categoria where I want to get the Categoria.Name property, can anyone help me?. Thanks
© Stack Overflow or respective owner