Hi All,
Must be mising something obvious here, help! Trying to add a calculated column to a typed view. The calculation needs to be done in code, not an sql aggreagate function. All the examples I find are using SQL agregate functions.
I have added a new column to the partial class for the typed view and added the column property. Also added the code to do the calculation. All this works, how do I get it to update the column in the underlying datatable so I can bind it to a grid?
I can do it after the Fill is done with a loop, I was hoping there was a way to do it within the TypedView and not the presentation code.
Thanx Colin...
Partial Public Class DksdirecommunicationTypedView
Dim _columnECommunications As DataColumn
Protected Overrides Sub OnInitialized()
_columnECommunications = New DataColumn("eCommunications", GetType(System.String), Nothing, MappingType.Element)
_columnECommunications.ReadOnly = False
_columnECommunications.Caption = "eCommunications"
Me.Columns.Add(_columnECommunications)
MyBase.OnInitialized()
End Sub
Friend ReadOnly Property eCommunications As DataColumn
Get
Return _columnECommunications
End Get
End Property
End Class
Partial Public Class DksdirecommunicationRow
Public ReadOnly Property ECommunicationss As String
Get
Select Case Me.Methodtype
Case AXDatabase.EntityClasses.Base_Enum.DirECommunicationMethodType.Email
Return Me.Email
Case AXDatabase.EntityClasses.Base_Enum.DirECommunicationMethodType.Phone
Return Me.Phone
Case AXDatabase.EntityClasses.Base_Enum.DirECommunicationMethodType.Telex
Return Me.Telex
Case AXDatabase.EntityClasses.Base_Enum.DirECommunicationMethodType.URL
Return Me.Url
Case Else
Return ""
End Select
End Get
End Property
End Class