How to assign Expression property of a DataColumn to a custom function?

A

anonymous

I want to assign a column of my datagrid to the return
value of a
custom function. Input parameter of the function should be
the value
of another column in the same datagrid.
Something like this:

tempDataColumn = tempDataTable.Columns.Add("MyID",
GetType(String))

tempDataColumn2 = tempDataTable.Columns.Add("MyDesc",
GetType(String))
tempDataColumn2.Expression = GetDesc("MyID")

Public Function GetDesc(ByVal ShortName As String) As
String
'//Some LOgic
Return "Desc"
End Function

Basically, I want to do some look-up before populating the
datatable
and binding it to a datagrid.

Would appreciate any help or any other way to do the same
stuff.

Thanks and Regards,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top