Template columns in Datagrid

T

tjk

I'm trying to use template columns in a datagrid for controls like checkbox, textbox and drop-down lists. The data I'll load into the datagrid comes from other parts of the ASP form. I load the data into a datatable and bind that to the datagrid using a dataview.

In the code below, I expect to see my static values display in the datagrid when the form loads. Instead I get a datagrid with 2 labels and a textbox but no data. I created the grid with 3 template columns and used the template editor to insert the labels and textbox

Can anyone tell me what I missed
Thanks
tj

Dim dtTable1 = New DataTable

' Add columns to tabl
dtTable1.Columns.Add(New DataColumn("Table", GetType(Label))
dtTable1.Columns.Add(New DataColumn("Column", GetType(Label))
dtTable1.Columns.Add(New DataColumn("Values", GetType(TextBox))

Dim drRow1 As DataRo
drRow1 = dtTable1.NewRo
drRow1(0) = "Customer
drRow1(1) = "State
drRow1(2) = "test
dtTable1.Rows.Add(drRow1

' Create a new dataview and bind it to the datagri
With dgQuer
.Visible = Tru
.DataSource = New DataView(dtTable1
.DataBind(
End Wit
 
N

Nikerz Inc

Check out your HTML template and try it only with itemtemplate instead of
having the additional alternatetemplate code. I've had the same problem
with a repeater control only showing a small amount of the actual
information in the query.


tjk said:
I'm trying to use template columns in a datagrid for controls like
checkbox, textbox and drop-down lists. The data I'll load into the datagrid
comes from other parts of the ASP form. I load the data into a datatable
and bind that to the datagrid using a dataview.
In the code below, I expect to see my static values display in the
datagrid when the form loads. Instead I get a datagrid with 2 labels and a
textbox but no data. I created the grid with 3 template columns and used
the template editor to insert the labels and textbox.
 

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

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top