I have two tables.
STAFFMEMBER
StaffNumber : int PK
FirstName : nvarchar(50)
LastName : nvarchar(50)
TeamID : int FK
TEAM
TeamID : int PK
TeamName : nvarchar(50)
Using the entity framework and RadGrid (2008.3.1105) I am attempting to edit the staff members. Retreiving the list of staff members requires me to include the Team object in oder to update and view the team they belong to. I therefore have to use an object query instead of the EntityDatasource (which works) to navigate the object graph.
In my StaffGrid_NeedDataSource method I have the following code:
protected void Grid_NeedDataSource(object source, GridNeedDataSourceEventArgs e) | |
{ | |
StaffGrid.DataSource = context.StaffMembers.Include("Team").OrderBy(p=>p.LastName); | |
} |
When I select a row to edit via a LinkButton, with CommandName="Edit" I get the following error:
"The ObjectContext must be configured by 1) defining ContextTypeName, 2) defining both ConnectionString and DefaultContainerName, 3) defining ContextType, or 4) supplying it in the OnSelecting event."
These attributes in the error are defined in an EntityDataSource which I am not using due to my customised object query.
I have been using RadGrid for a long time with the ObjectDataSource and am moving to the Entity Framework.
What exactly am I missing or is this not fully supported?