<!-- Markup: -->
<asp:TemplateField HeaderText='<%# SomeFunction() %>'>
'codebehind:
Public Function SomeFunction() As String
Return "Hello"
End Function
<!-- Markup: -->
<asp:TemplateField HeaderText='<%# SomeFunction(VariableToPass) %>'>
'codebehind:
Public Function SomeFunction(ByVal SomeVariable As String) As String
'do something with the variable:
If SomeVariable = "Hello" Then
Return "Hello Stan"
ElseIf SomeVariable = "Goodbye" Then
Return "Daisy, Daisy"
Else
Return String.Empty
End If
End Function