Luke thanks for the answer.
It sort of helps but say you have more than one property on the sub object
you want to access through the datapropertyname for each column
eg.
col1.DataPropertyName = "Address.city"
col2.DataPropertyName = "Address.postcode"
public class Address
{
private string _City;
private string _postcode
public string PostCode
{
get { return this._PostCode; }
set { this._PostCode = value; }
}
public string City
{
get { return this._City; }
set { this._City = value; }
}
public Address()
{
this._City = "";
}
public override string ToString()
{
return this._City;
}
}
--
Life in the sun
"WayDownUnder" wrote:
I have a datagridview that is bound to a cutom collection.
The classes contained in the custom collection have the properties that are
bound to the class . This works fine !
But if one of the properites exposes another object I would like to bind a
property of the sub object to the DataPropertyName this does not seem to
work.
eg main object customer
has a property called Address which is a contained object
inside object Address there is property call city.
so DataPropertyName = "Address.city"
does not work !
Any ides
--
Life in the sun