Hello,

I'm working on an application and somewhere in the code  I wrote this
function :

        Protected Function AddComputedColumn(Of TSource As Msg.Message)
(ByVal displayString As String, _
                                                    ByVal dataMember
As String, _
                                                    ByVal
computeDelegate As ING.Framework.Utils.FunctionDelegate(Of String,
TSource), _
                                                    Optional ByVal
width As Integer = 100) As GridEXColumn

            Dim result As GridEXColumn = Me.Grid.AddComputedColumn(Of
TSource)(displayString, dataMember, computeDelegate, width)
            If (mComputedColumns Is Nothing) Then
                mComputedColumns = New Dictionary(Of String,
ING.Framework.Utils.FunctionDelegate(Of String,
ING.Framework.Msg.Message))
            End If

            mComputedColumns.Add(result.Key, computeDelegate)
            'The line above givesCOMPILATION ERROR : Value of type
'ING.Framework.Utils.FunctionDelegate(Of String, TSource)' cannot be
converted to 'ING.Framework.Utils.FunctionDelegate(Of String,
ING.Framework.Msg.Message)'

            Return result

        End Function

I also have this property :
        Protected mComputedColumns As Dictionary(Of String,
ING.Framework.Utils.FunctionDelegate(Of String,
ING.Framework.Msg.Message))

        Public ReadOnly Property ComputedColumn() As Dictionary(Of
String, ING.Framework.Utils.FunctionDelegate(Of String,
ING.Framework.Msg.Message))
            Get
                Return mComputedColumns
            End Get
        End Property

I can't understand why it is unable to make the conversion since the
TSource is type ING.Framework.Msg.Message.

Is it logic ? or Do I something wrong ?

Reply via email to