I have this following data source binding:
MembershipProvider provider = new MembershipProvider();
UserUpdateLogs userUpdateLogs = provider.GetUserUpdateLogs(username);
dgUserUpdateLog.DataSource = userUpdateLogs.Logs;
dgUserUpdateLog.DataBind();
Logs is a collection of UserUpdateLogEntry. This class owns the UserData Property, and UserData contains other properties. My aspx:
<Columns>
<asp:BoundColumn DataField="ChangeDate" Visible="true" HeaderText="Date"/>
<asp:BoundColumn DataField="UserData.Sex" HeaderText="Sex" />
<asp:BoundColumn DataField="UserData.Phone" HeaderText="Phone" />
</Columns>
The first row (ChangeDate) seems to work well. But when rendering the second BoundColumn, the following error is shown:
A field or property with the name 'UserData.Sex' was not found on the selected data source.
Why does it happen? Can't Aspx recognize a concatenation of properties like PropertyA.PropertyB?
I've checked the object and all properties have valid data.