473,394 Members | 1,787 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

how to create a TemplateField programmatically?

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

Oct 22 '06 #1
0 1521

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: sck10 | last post by:
Hello, I am trying to programically make the following TemplateField ("MyTemplate") visible when the user clicks on the "Edit" Button using the PreRender handle event. My question is, how do...
2
by: markm75c | last post by:
Does anyone know of a way to sort a column which isnt databound or an actual field in the database, but is derived from a method? IE. I have a grid showing stats for softball, with a calculated...
1
by: sloan | last post by:
I am programmatically adding BoundField's and TemplateField's to a GridView. I have it working fine. BoundField bf = new BoundField(); bf.DataField = "EmpID"; bf.HeaderText = "The Employee...
0
by: Cas | last post by:
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...
0
by: cook.jonathan.m | last post by:
I want to programmatically add a dropdown to each row in a certain column returned to the gridview by my query. I want to do this entirely in behind-code. My gridview tag in the page will have...
1
by: jobs | last post by:
CommandArgument does not contain row index when command under Templatefield of- Gridview It appears CommandArgument passed to the rowcommand event does not contain row index when the command is...
0
by: mesut | last post by:
Hi colleagues, I'm confused when to use Boundcolumn and when to use TemplateField in ASPX pages. If I use BoundField control how can I get the field value in code behind? If I use BoundField...
1
by: mghihor | last post by:
Dear GridView Experts! I have problems with GridView when adding a column using TemplateField. I fill GridView1 from a stored procedure. It has a Select statement and returns 14 columns,...
2
by: Elmo Watson | last post by:
I've converted a buttonfield to a TemplateField with a button in it Previously, in the Rowcommand, to identify the row when the ButtonField was clicked, I had this code: Dim index As Integer =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.