Hello
I am using the below code to retrieve a entitycollection to bind to a RadGrid.
EntityCollection orders = new EntityCollection(new OrderEntityFactory());
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.Relations.Add(OrderEntity.Relations.OrderDetailEntityUsingOrderId);
bucket.Relations.Add(OrderEntity.Relations.UserEntityUsingUserId);
IEntityField2 ent = EntityFieldFactory.Create(containingObjectName, fieldName);
AddFilterToBucket(datatype, valueTextBox.Text, bucket, ent);
IPrefetchPath2 prefetchPath = new PrefetchPath2((int)EntityType.OrderEntity);
prefetchPath.Add(OrderEntity.PrefetchPathUser);
prefetchPath.Add(OrderEntity.PrefetchPathOrderDetail);
using (DataAccessAdapter adapter = new DataAccessAdapter())
{
adapter.FetchEntityCollection(orders, bucket, prefetchPath);
}
ReportTest.DataSource = orders;
ReportTest.DataBind();
When I bind to the radGrid for columns from the UserTable I am setting the datafield to user.columnName, which displays the value, for columns from the order table I am setting the datafield to columnName, which also works, but when I try and bind columns from the OrderDetail Table by using OrderDetail.ColumnName, I get this error:
Unable to find property OrderDetail.ColumnName within a DataItem of type EntityClasses.OrderEntity
I don't understand why I am getting this error only on the order detail table.
What am I doing wrong?
Thanks in advance
Bex