how to create a TemplateField programmatically?

  • Thread starter Thread starter Cas
  • Start date Start date
C

Cas

Hi,

I want to create a InsertItemTemplate in a detailsview (only
insertmode)programmatically.
I first defined a Template, then i tried to create within that templatefield
a InsertItemTemplate (but i don't know how), and finally a textbox.

I did this: (Detailsview1 is defined in the .aspx file)

Dim tfield As TemplateField
Dim tb As TextBox
tfield = New TemplateField
tb = New TextBox
tb = tfield.InsertItemTemplate
DetailsView1.Fields.Add(tfield))
DetailsView1.Fields(0).HeaderText="ok"
.....

But it doesn't work.No error, but i can't see (and use) the texbox. All i
see is the headertext ("ok").


Thanks for help
Cas
 
Back
Top