Has anybody had success doing this? I have a very simple app that I want to provide a nice heretical view. It seems like it should be very simple. I have three tables Classes, Employees, EmployeeClasses (the intersection table). I fetch the data like this
ClassCollection cc = new ClassCollection();
ISortExpression sorter = new SortExpression(DAL.FactoryClasses.SortClauseFactory.Create(ClassFieldIndex.Dept, SortOperator.Ascending));
sorter.Add(DAL.FactoryClasses.SortClauseFactory.Create(ClassFieldIndex.CourseName, SortOperator.Ascending));
IPrefetchPath prefetchPath = new PrefetchPath((int)EntityType.ClassEntity);
prefetchPath.Add(ClassEntity.PrefetchPathEmployee);
cc.GetMulti(null, 0, sorter, null, prefetchPath);
gridClasses.DataSource = cc;
gridClasses.DataBind();
I checked profiler and it looks like I am getting the right data back.
The problem is when I bind all I get is Classes and a plus sign to only displays the EmployeeClass information (basically only the two foreign keys)? Obviously the EmployeeClassId, ClassId and EmployeeId are meaningless. So I get:
-ClassName
--------EmployeeClassId ClassId EmployeeId (EmployeeClass.EmployeeId and Employee.EmployeeId is 1:1)
What I would like is to display properties for the EmployeeEntity so it would look like this:
-ClassName
--------FullName PhoneNumber ect.
The Infragistics grid give you a BaseColumnName to tell each band what to display. Basically I would like it if I could say BaseColumnName = Employee.FullName instead of BaseColumnName = EmployeeId (from the EmployeeClass table) etc. But obviously that will not work. Anybody had success with this? I am sure this has been done millions of times by thousands of people but I am struggling for a solution. Thanks in advance.