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.
Hello JoeK486,
Thank you for posting in the community.
It seems that this is not possible at the moment. If your nested object is not very complex, you could just replace it with several other fields, for example - place the City, State, etc. fields directly in Users class.
If you have any further questions, please let me know.
Hi JoeK486,
I'm just checking if you need any further assistance with the matter.
Hi, thanks for your response. We ended up doing a web service to implement this functionality.
I'd definitely like to recommend that Infragistics look into this issue to see if there is a way to implement this, as objects nested in other objects are not an uncommon practice.
Any update on this issue. Is this feature available in v13
Hi,
I am working with Infragistics4.WebUI.Shared.v11.2 and facing the same issue..
pulic class Goal
public Goal();
public DateTime FromDate { get; set; }
public int GoalID { get; set; }
public StandardGoal StandardGoal { get; set; }
public int Target { get; set; }
public DateTime ToDate { get; set; }
Public class StandardGoal
public StandardGoal();
public GoalType GoalType { get; set; }
public string Name { get; set; }
public int StandardGoalId { get; set; }
public int TargetValue { get; set; }
<ig:BoundDataField DataFieldName="StandardGoal.Name" Key="StandardGoal.Name">
<Header Text="Standard Goal" />
</ig:BoundDataField>
<ig:BoundDataField DataFieldName="StandardGoal.TargetValue" Key="StandardGoal.TargetValue">
<Header Text="Target" /> </ig:BoundDataField>
and I can not replace StandardGoal class inside Goal class..
I'd appreciate any help thanks..