Hi,
You need to capture the ItemDataBound event which is fired for each
row when it is being bound and change the value. Here's the code.
This only works if it is a DataBound Column. If its a Template Column
then you will need to pull the label control out of cell, cast it, and
then set the value.
Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal
e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles
DataGrid1.ItemDataBound
Dim sexIDColumn As Integer = 5 ' whatever the column number is
If e.Item.ItemType = ListItemType.EditItem Or e.Item.ItemType
= ListItemType.AlternatingItem Then
' Get sexID
If e.Item.Cells(sexIDColumn).Text = "1" Then
e.Item.Cells(sexIDColumn).Text = "male"
Else
e.Item.Cells(sexIDColumn).Text = "female"
End If
End If
End Sub
I hope this helps.
Mike Douglas