Last post Jun 13, 2012 12:59 PM by Tessie
Jun 13, 2012 12:59 PM|Tessie|LINK
I'm working in VS 2010. I have two entities: Notes and SystemUser with a foreign key association on UserID. The SystemUser table has the complete user name ("FullName"), and I'd like to display the user name in the gridview for the Notes collection (in SQL
terms, join the two tables on UserID and get the SystemUser.FullName for the @UserID parameter). Notes is listed as a navigation property for the SystemUser entity in the data model, and SystemUser is a navigation property for the Notes entity.
I've inserted "Include=SystemUser" in the EntityDataSource used to populate the Notes gridview, and added a BoundField with DataField=FullName in the gridview. However, I've been unable to get the FullName value (error: A field or property with the name
'FullName' was not found on the selected data source.).
Does anyone have any suggestions for me, please?
Thanks in advance.
Update: I just got it! I had to change the asp:BoundField element to a TemplateField and use Eval("SystemUser.FullName") for the value--and it works fine :) Hope this helps someone else....