What follows are snippets of two classes that I am using:
public class Location
{
private string locationCode;
public String LocationCode
{
get { return locationCode;}
set { locationCode = value; }
}
}
public class User
{
private Location location;
public Location Location
{
get { return location;}
set { location = value}
}
}
I have bound a GridView control to a collection of User objects. Within the GridView I need to display the LocationCode. On the GridView Smart Tag, I went to the Edit Columns dialog. No matter what I entered for the Data Field (I tried User.Location.LocationCode)
I was not able to Bind to the location Code.
Can this be accomplished without creating a property in the User Class that exposes the Location Code?
mikener
Member
534 Points
238 Posts
How do I Data Bind a GridView Control to an object data source that has imbedded objects
Jun 06, 2006 08:14 PM|LINK
What follows are snippets of two classes that I am using:
public class Location
{
private string locationCode;
public String LocationCode
{
get { return locationCode;}
set { locationCode = value; }
}
}
public class User
{
private Location location;
public Location Location
{
get { return location;}
set { location = value}
}
}
I have bound a GridView control to a collection of User objects. Within the GridView I need to display the LocationCode. On the GridView Smart Tag, I went to the Edit Columns dialog. No matter what I entered for the Data Field (I tried User.Location.LocationCode) I was not able to Bind to the location Code.
Can this be accomplished without creating a property in the User Class that exposes the Location Code?
Thanks