K
kashif456
Hi,
I am adding textbox and label control programatically and need some
assistance in getting these to show up in a table. Here's my code:
For i = 0 To dv.Count - 1
SaleAttributeTextField = "Sale_Attribute_" &
dv.Table.Rows(i)("SalesAttributeID")
SaleAttributeLalbel = "Sale_Attribute_Label_" &
dv.Table.Rows(i)("SalesAttributeID")
Dim textBox As TextBox
textBox = New TextBox
textBox.Enabled = EditMode
textBox.ID = SaleAttributeTextField.ToString
Dim AttribLabel As Label
AttribLabel = New Label
AttribLabel.ID = SaleAttributeLalbel.ToString
AttribLabel.Text =
dv.Table.Rows(i)("SalesAttributeDisplayName")
'''note: Need to add <tr><td> tags here
Controls.Add(AttribLabel)
''' Need to add </td></tr><tr><td> tags here
Controls.Add(textBox)
'' need to add </td></tr> tags here
filter = "SalesAttributeID=" &
dv.Table.Rows(i)("SalesAttributeID")
dv2.RowFilter = filter
If dv2.Count() > 0 Then
textBox.Text =
dv2.Table.Rows(rowCounter)("SalesAttributeValue")
rowCounter = rowCounter + 1
Else
textBox.Text = ""
End If
Next
I am adding textbox and label control programatically and need some
assistance in getting these to show up in a table. Here's my code:
For i = 0 To dv.Count - 1
SaleAttributeTextField = "Sale_Attribute_" &
dv.Table.Rows(i)("SalesAttributeID")
SaleAttributeLalbel = "Sale_Attribute_Label_" &
dv.Table.Rows(i)("SalesAttributeID")
Dim textBox As TextBox
textBox = New TextBox
textBox.Enabled = EditMode
textBox.ID = SaleAttributeTextField.ToString
Dim AttribLabel As Label
AttribLabel = New Label
AttribLabel.ID = SaleAttributeLalbel.ToString
AttribLabel.Text =
dv.Table.Rows(i)("SalesAttributeDisplayName")
'''note: Need to add <tr><td> tags here
Controls.Add(AttribLabel)
''' Need to add </td></tr><tr><td> tags here
Controls.Add(textBox)
'' need to add </td></tr> tags here
filter = "SalesAttributeID=" &
dv.Table.Rows(i)("SalesAttributeID")
dv2.RowFilter = filter
If dv2.Count() > 0 Then
textBox.Text =
dv2.Table.Rows(rowCounter)("SalesAttributeValue")
rowCounter = rowCounter + 1
Else
textBox.Text = ""
End If
Next