I am using Entity Framework in this instance and would like to group my radgrid by a field located in another table related to the main item. I have used an include statement to bring back the additional entity (one to one relationship between these tables) as lazy loading is enabled. I want to group on "Title" field in my table "Activity" The navigation property is "Activity1" so I have used the following to populate my datasource:
_context.LEResults.Include("Activity1").Where(R => R.EmployeeID == EmployeeId && R.Active == true).OrderBy(E => E.AttemptDate).ToList();
I know this is working because I can display Activity1.Title as a regular gridboundcolumn.
I have got this to work before and actually have the other project in front of me but I cannot figure out what is different. Is there anything anyone can think of that I may have missed? The following code informs me that the field Activity1.Title is missing from my source table.
<GroupByExpressions>
<telerik:GridGroupByExpression>
<GroupByFields>
<telerik:GridGroupByField FieldName="Activity1.Title" />
</GroupByFields>
<SelectFields>
<telerik:GridGroupByField FieldName="Activity1.Title" HeaderText="Activity" />
</SelectFields>
</telerik:GridGroupByExpression>
</GroupByExpressions>
_context.LEResults.Include("Activity1").Where(R => R.EmployeeID == EmployeeId && R.Active == true).OrderBy(E => E.AttemptDate).ToList();
I know this is working because I can display Activity1.Title as a regular gridboundcolumn.
I have got this to work before and actually have the other project in front of me but I cannot figure out what is different. Is there anything anyone can think of that I may have missed? The following code informs me that the field Activity1.Title is missing from my source table.
<GroupByExpressions>
<telerik:GridGroupByExpression>
<GroupByFields>
<telerik:GridGroupByField FieldName="Activity1.Title" />
</GroupByFields>
<SelectFields>
<telerik:GridGroupByField FieldName="Activity1.Title" HeaderText="Activity" />
</SelectFields>
</telerik:GridGroupByExpression>
</GroupByExpressions>