Reputation:
I have a Linqdatasource that groups the records in table:Routing by a field called SubmitTo. My select statement is this - "new (key as SubmitTo, Count() as Count, it as Routings)". Now the SubmitTo field is only a foreign key reference the primary key in table:Department which has a field:DeptName with the full name of the department. How do I reference that field:DeptName after I bound the linqdatasource to a gridview? I tried "Department.DeptName" but it is not working. I tried bounding the linqdatasource without using groupby and the reference "Department.DeptName" works.
Upvotes: 3
Views: 891
Reputation: 134
The simplest answer I can think of would be to join the tables, then group by Department.DeptName
rather than the SubmitTo
field. I don't know if there's an easier way though.
Upvotes: 0
Reputation: 1835
Could you use this?
new (key as SubmitTo, key.DeptName as DeptName, Count() as Count, it as Routings)
Upvotes: 0