Hi,
at first, i have now 1 year experience with ES and i am very happy for this useful and worksaving tool. Now my problem:
i am using SQL 2005, ES 2007.1.1119.0, MyGeneration Version # 1.2.0.7, Infragistics 7.2 in vb.net, net 2.0
My Hierarchical DB-Structure is like following
Partner
Addresse
Telekom
Vertrag
VertragStatus
VertragContent
The Tables are connected by keys. I have SP for my tables and I bind my PartnerCollection to a BindingSource and later the Grid.DataSource = CF.BindingSource. This works very fine and in the grid appears all level of the hierarchy.
Now i want extend my tables. I oriented my on your example: http://www.entityspaces.net/blog/2007/10/22/EntitySpaces2007V110210Expounded.aspx
For the table Partner i wrote a join to other table like in your example and added a new column. In your example you use GetLocalBindingProperties, but this produced errors (see later). I tried it without GetLocalBindingProperties and after using .CreateColumnsForBinding, the new field in grid was visible. So i am a little confused, but it works.
Protected Overloads Overrides Function GetLocalBindingProperties()
As List(Of EntitySpaces.Core.esPropertyDescriptor)
Dim props As New List(Of esPropertyDescriptor)
props.Add(New esPropertyDescriptor(Me, "VermittlerName", GetType(String)))
Return props
End Function
In your example you use also a column FakeColumn. This is a very practice and useful feature, when its works. I tried it, but i run in errors.
1. I also created GetLocalBindingProperties Function in the Class Partner (the Top-Level Hierarchie) and a corresponding Property Set and Get. When i inserted this code, then i become the error from infragistics grid: no data for the bands of the lower level of hierarchie available. After .load from the PartnerCollection i debugged the first Item and the suborderd collections like AdresseCollectionByPartnerGUID, TelekomCollectionByPartnerGUID, VertragCollectionByPartnerGUID were set to Nothing (But i'm not sure that this will be filled later via lazy loading). After continuing in the grid appeared only the first top-level table Partner.
2. I tried the same in the Vertrag (2nd level) and the UltraGrid Error event reported the long message:
Unable to get the CurrencyManager from the BindingContext. The BindingContext threw an exception from its indexer. This may happen for variety of reasons. One such reason is when creating the currency manager for a child band, the currency manager may fail to get instantiated because it is not be able to retrieve an instance of IList from the parent list object. This can occur when the parent list has 0 items and thus no parent list object to retrieve the child list from. In such a case the child currency manager attempts to add a temporary item to the parent list so it can retrieve a child list instance from the parent list object. If this fails, because for example the list is read-only or does not support adding, then the currency manager will fail to be instantiated, resulting in an exception being thrown by the BindingContext indexer. The UltraGrid will proceed with further retrieval of the data structure however it will not be able to display this particular child band level and its descendants since UltraGrid can not retrieve the proper data structure for this band at this time. However note that the UltraGrid will make further attempts at retrieval under appropriate conditions, like for example when the parent currency manager raises PositionChanged notifications, which may be in response to adding of an item in the parent list object or change in the current item of an ancestor currency manager. Possible workarounds may be to implement IBindingList on the data source if it already doesn't implement this interface. UltraGrid makes use of this interface for retrieving the data structure if it fails to obtain the CurrencyManager from the BindingContext. If this failure is due to a parent list being read-only and having 0 items, you can temporarily enable adding while the data source binding is taking place.
After continuing in the Grid appeared the Top-Level Table Partner, and all other subordered Bands except the Band Vertrag (VertragCollectionByPartnerGUID).
What did i wrong or wath understand i false?
Thank for help.
Wolfgang