If I add a property in class inherited from an entity (in my main project), this property wont show up in a bound datagrid.
But If I add the same property in a partial class of the entity in the generic DAL project, the property will show up.
Where is the difference? What I'm missing?
Sample code:
I have a PersonaEntity entity.
In my DAL project I add the following property in a partial class file:
Namespace ISI.AlboTop.DAL.DBDati.EntityClasses
Partial Public Class PersonaEntity
Private maaaa As String
Public Property AAAAAAAAAAAAAAAAAAAAA() As String
Get
Return maaaa
End Get
Set(ByVal value As String)
maaaa = value
End Set
End Property
End Class
End Namespace
then, in my main project, I create a new class that inherit from PersonaEntity to add another property:
Public Class InherithedPersonaEntity
Inherits PersonaEntity
Private mBBBB As String
Public Property BBBBBBBBBBBBBBBBBBBBB() As String
Get
Return mBBBB
End Get
Set(ByVal value As String)
mBBBB = value
End Set
End Property
End Class
Now, I create an instance of my InherithedPersonaEntity entity, put it in an entitycollection, and bind it to a grid
Dim entColl As New EntityCollection(Of InherithedPersonaEntity)
Dim inheritedPerson As New InherithedPersonaEntity
inheritedPerson.AAAAAAAAAAAAAAAAAAAAA = "TEST PROPERTY AAAAAAAAAAAAAAAAAAAAAAAA"
inheritedPerson.BBBBBBBBBBBBBBBBBBBBB = "TEST PROPERTY BBBBBBBBBBBBBBBBBBBBBBBB"
entColl.Add(inheritedPerson)
Dim frmEntColl As New frmDataGrid(entColl)
frmEntColl.Show()
in the datagrid I see the "AAAAAAAAAAAAAAAAAAAAA" column, but I don't see the "BBBBBBBBBBBBBBBBBBBBB" column.
Why can't I see the "BBBBBBBBBBBBBBBBBBBBB" column?
Where is the difference between these 2 properties?
If I use a List(Of InherithedPersonaEntity) like a datasource (instead that the EntityCollection(Of InherithedPersonaEntity)) the datagrid will show the "BBBBBBBBBBBBBBBBBBBBB" column.
But I can't fetch a List(Of InherithedPersonaEntity).
I'm definitely missing something....