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.
            Asked
            
        
        
            Active
            
        
            Viewed 886 times
        
    2 Answers
0
            
            
        Could you use this?
new (key as SubmitTo, key.DeptName as DeptName, Count() as Count, it as Routings)
        Jonathan Bates
        
- 1,835
 - 14
 - 22
 
0
            
            
        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.
        MBirchmeier
        
- 134
 - 7