Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
120
Binding nested object's fields to BoundDataField
posted

Hello, I am having trouble accessing the nested object's properties in order to bind it to a BoundDataField. I have a User object that looks something like this:

public class User

{

    public int ID {get;set;}

    public AddressObj Address {get;set;}

}

with the AddressObj looking like this:

public class AddressObj

{

    public string Street {get;set;}

    public string City {get;set;}

    public string State {get;set;}

    public string Zip {get;set;}

}

 

After binding the User objects to the WebDataGrid, I tried to use a BoundDataField to display the City field, like so:

<ig:BoundDataField DataFieldName="Address.City" Key="City"></ig:BoundDataField>

However, this results in an error, stating that no Data Field Name can be found matching Address.City.

I know that I could use a TemplateDataField and use an Eval statement to get the data to display (and that is what I'm doing now), but I want the user to be able to filter this column, which cannot be done on a TemplateDataField using the Infragistics filtering behaviors.

I'd appreciate any help or advice for fixing this problem, thanks.

Parents Reply Children
No Data