I have an ASP.net gridview I'm trying to associate with. My DataSource has a collection and 2 of the columns that I link are part of a subclass. My DataSource has a subclass of "Staff" containing personnel information. Related fields SurveyID and NumberOfExceptions are perfectly related, but Staff.Name and Staff.Office cannot be connected.
asp:BoundField DataField="SurveyID" HeaderText="ID" ... asp:BoundField DataField="Staff.Name" HeaderText="Name" ... asp:BoundField DataField="Staff.Office" HeaderText="Office" ... asp:BoundField DataField="NumberOfExceptions" HeaderText="Exceptions" ...
And the code behind:
uxSurveyGrid.DataSource = searchResults; uxSurveyGrid.DataBind();
If I type searchResults[0].Staff.Name in the code behind, I see this value, why can't the runtime evaluate Staff.Name in gridview?
How do you bind columns to subclass values? Should I do this in code?
Any help would be appreciated
Mark.
Mark kadlec
source share