I have DbLinq-Sql class containing invoice headers.
Invoice header class definition contains customer id field _customer which
is related to customer table:
[Table(Name = "invoice")]
public partial class Invoice: IModified {
protected string _customer;
protected string _id;
[Column(Name = "id", DbType = "integer(32,0)", IsPrimaryKey = true,
IsDbGenerated = true)]
public int Id {
get { return _id; }
set { _id = value; IsModified = true; }
}
private EntityRef<Klient> _invoice_customer_fkey_customer;
[Association(Storage="_customer",
ThisKey="customer",Name="invoice_customer_fkey")]
public Customer invoice_customer_fkey_customer {
get { return this._invoice_customer_fkey_customer.Entity; }
set { this._invoice_customer_fkey_customer.Entity = value; }
}
}
I want to show invoice header data and customer name in .NET 2 WinForms
DataGridView.
I need to set DataGridView column to display values from Invoice and
Customer entities,
the following properties from List<Invoice> Invoices:
Invoices.Id
Invoices.invoice_customer_fkey_customer.Name
Any idea how to create such DataGridView ?
Andrus.
Nicholas Paldino [.NET/C# MVP] - 20 Dec 2007 18:11 GMT
Andrus,
You are going to have to flatten out that structure manually, either by
creating a new type/data table and then populating that, or you will have to
create some custom type descriptors which the data grid view will work with
to flatten the structure.

Signature
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
> I have DbLinq-Sql class containing invoice headers.
>
[quoted text clipped - 37 lines]
>
> Andrus.