G
Guest
Hi,
I am binding a collection of "Orders" to a datagrid and I want to display
"Product.Description" to a column, product being a member of Order class.
Code:
DataGridTextBoxColumn productColumn = new DataGridTextBoxColumn();
productColumn.MappingName = "Product.ID";
productColumn.HeaderText = "Product";
tableStyle.MappingName = "SalesOrderProduct";
ProductLineGrid.TableStyles.Add(tableStyle);
productLineGrid.DataSource = _orders;
Classes:
class Order
{
public OrderProduct Product
{
get;
}
....
}
class OrderProduct
{
public string Description
{
get;
}
....
}
Binding a column to "Product.Desctription" does not seem to work. Is there a
way to bind property of a child tho the grid?
Thanks,
Rakesh
I am binding a collection of "Orders" to a datagrid and I want to display
"Product.Description" to a column, product being a member of Order class.
Code:
DataGridTextBoxColumn productColumn = new DataGridTextBoxColumn();
productColumn.MappingName = "Product.ID";
productColumn.HeaderText = "Product";
tableStyle.MappingName = "SalesOrderProduct";
ProductLineGrid.TableStyles.Add(tableStyle);
productLineGrid.DataSource = _orders;
Classes:
class Order
{
public OrderProduct Product
{
get;
}
....
}
class OrderProduct
{
public string Description
{
get;
}
....
}
Binding a column to "Product.Desctription" does not seem to work. Is there a
way to bind property of a child tho the grid?
Thanks,
Rakesh