Need your assistance on this issue.
We need to fetch certain entities, e.g. PlayContainerEntities. We also need the underlying PlayerStreamCollection within each PlayContainerEntity as well.
We have extended these classes as we need to add in extra information for showing in Datagrid
The hierarchy goes like this
- DbPlayContainerEx extension of PlayContainerEntity
Each PlayContainerEntity contains PlayerStreamCollection and we want it to be our defined type rather than of type PlayerStreamEntity so we defined the below class as well
- DbPlayerStreamEx extension of PlayerStreamEntity
All PlayContainerEntity are easily loaded into our defined EntityCollection<DbPlayContainerEx> m_playContainerCollectionNew.
Using these statements we fetch the required data:
IPrefetchPathElement2 prefetchPath = DbPlayContainerEx.PrefetchPathPlayerStreamCollection;
prefetchPath.EntityFactoryToUse = new DbPlayerStreamExFactory();
fetchPath.Add(DbPlayContainerEx.PrefetchPathPlayerStreamCollection, new DbPlayerStreamExFactory());
adapter.FetchEntityCollection(m_playContainerCollectionNew, null, int.MaxValue, Order, fetchPath);
playContainerCollectionNew contains the collection of all PlayContainer Entities and the corresponding PlayerStreamCollection for each PlayContainer Entity. PlayerStreamCollection is shown as a collection of our defined type DbPlayerStreamEx. But when we bind this collection to our DataGrid it doesn’t get displayed in the DataGrid.
Setting AutoGenerateFields=”True” in our DataGrid settings we see that PlayerStreamCollection is in fact of type PlayerStreamEntity and all the fields of PlayerStreamEntity are displayed as columns rather thanour custom defined properties in DbPlayerStreamEx. How could I override PlayerStreamCollection in my custom defined DbPlayContainerEx
Any suggestion is appreciated.