how to create an InsertItemTemplate in detailsview programmatically?

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top