Could someone help me figure out how to programmatically create a simple
LABEL in a template column? I have a GridVIEW that needs to have a dynamic
number of columns which is simple enough for me :) but the tricky part is
trying to add data inside the column. I tried intuitively figuring out what
to do by working my way backwards from the templatefield object and then
through the controls collection and the datacontrolfields collection, etc
etc, but I think I'm heading in the wrong direction. Can someone set me
straight?

For simple argument's sake, let's just say I'm trying to add a label that
says "BLA" in the main (non edit mode) template.

I found one MSDN article dealing with DataControlFieldCells, but it only
gave a tiny tiny snippet of code and wasn't really much help. Here's my code.
It's pretty basic:


Dim zzz As Integer
Dim headtext As String

''' Create columns dynamically
For zzz = 0 To (countcols - 1)

''' Testview tells me how many columns to add
''' Don't worry about where this info comes from
testrow = testview(zzz)

Dim newcol As New TemplateField

Dim cfield As New Label
cfield.Text = "BLA"


' No idea what to do here. This is where I need help
' How do I add CFIELD as a control inside of NEWCOLS's
' ITEMTEMPLATE class?


' This formats the columns just fine.
headtext = testrow("StatusName")
newcol.HeaderText = headtext
newcol.HeaderStyle.BackColor = Drawing.Color.Aqua

' Add the column.. works fine
GridView1.Columns.Add(newcol)
newcol = Nothing

Next zzz


'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''
GridView1.DataBind()