?
Solved

Add templatefield programatically

Posted on 2009-04-29
2
Medium Priority
?
316 Views
Last Modified: 2012-05-06
Hi, am trying to create a gridview programatically, I have the following code to ceate the boundfields but also need to create a templatefield with an image button.

Is there any way this can be achieved?
Thanks
Dim Field As New BoundField
 
Field.DataField = "JobNo"
Field.HeaderText = "Job No"
Field.ItemStyle.Width = 65
Field.HeaderStyle.HorizontalAlign = HorizontalAlign.Left
GridView4.Columns.Add(Col)
 
Field = New BoundField
Field.DataField = "NameAddress"
Field.HeaderText = "Name & Address"
Field.ItemStyle.Width = 293
Field.HeaderStyle.HorizontalAlign = HorizontalAlign.Left
Col = Field
GridView4.Columns.Add(Col)
 
Me.dgvProgram.DataSource = tblProgramData
Me.dgvProgram.DataBind()
Me.dgvProgram.Width = 766

Open in new window

0
Comment
Question by:Higgster
2 Comments
 
LVL 20

Accepted Solution

by:
informaniac earned 800 total points
ID: 24258579
0
 

Author Closing Comment

by:Higgster
ID: 31575837
Thanks.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question