how to create a TemplateField programmatically?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cas

    #1

    how to create a TemplateField programmatically?

    Hi,

    I want to create a InsertItemTempl ate in a detailsview (only
    insertmode)prog rammatically.
    I first defined a Template, then i tried to create within that templatefield
    a InsertItemTempl ate (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.InsertIt emTemplate
    DetailsView1.Fi elds.Add(tfield ))
    DetailsView1.Fi elds(0).HeaderT ext="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



Working...