S
StanB
I populate BindinSource with this collection:
=================
public class PreliminaryPickupRequest
{
private string shipper;
public string Shipper
{
get { return shipper; }
set { shipper = value; }
}
private Terminal pickupTerminal;
public Terminal PickupTerminal
{
get { return pickupTerminal; }
set { pickupTerminal = value; }
}
}
public class Terminal
{
private int key;
public int Key
{
get { return key; }
set { key = value; }
}
private string number;
public string Number
{
get { return number; }
set { number = value; }
}
}
=============================
Here is the problem:
I can bind Shipper column:
DataGridViewColumn c = new DataGridViewTextBoxColumn();
c.HeaderText = "Shipper";
c.Width = 300;
c.DataPropertyName = "Shipper";
dgvMain.Columns.Add(c);
but I cannot do this:
DataGridViewColumn c = new DataGridViewTextBoxColumn();
c.HeaderText = "Terminal";
c.Width = 300;
c.DataPropertyName = "Terminal.Number";
dgvMain.Columns.Add(c);
Is there a way to do it?
Thanks,
-Stan
=================
public class PreliminaryPickupRequest
{
private string shipper;
public string Shipper
{
get { return shipper; }
set { shipper = value; }
}
private Terminal pickupTerminal;
public Terminal PickupTerminal
{
get { return pickupTerminal; }
set { pickupTerminal = value; }
}
}
public class Terminal
{
private int key;
public int Key
{
get { return key; }
set { key = value; }
}
private string number;
public string Number
{
get { return number; }
set { number = value; }
}
}
=============================
Here is the problem:
I can bind Shipper column:
DataGridViewColumn c = new DataGridViewTextBoxColumn();
c.HeaderText = "Shipper";
c.Width = 300;
c.DataPropertyName = "Shipper";
dgvMain.Columns.Add(c);
but I cannot do this:
DataGridViewColumn c = new DataGridViewTextBoxColumn();
c.HeaderText = "Terminal";
c.Width = 300;
c.DataPropertyName = "Terminal.Number";
dgvMain.Columns.Add(c);
Is there a way to do it?
Thanks,
-Stan