Adding checkbox to ASP:Table control
I am trying to create table rows and add it into the ASP:Table.
I have created the table in design time and adding the cell from the program. Actually I am taking the data from data set and creating checkboxes and adding the same to table cell and adding the cell to the table row. The checkbox is shown but the text value is not shown.
code is as bellow.
For Each drr In viewDataset.Tables(0).Rows
Dim tcell As New TableCell
Dim trow As New TableRow
Dim dc As New DataColumn
Dim lit As New LiteralControl
Dim tlastcell As New TableCell
strResourceName = drr.ItemArray(2)
lit.Text = strResourceName
chk.Text = strResourceName
chk.ID = "chk" + strResourceName
chk.Visible = True
lbl.Text = strResourceName
tcell.Controls.Add(chk)
trow.Cells.Add(tcell)
TableAppRecords.Rows.Add(trow)
Next
The design time code is as follows
<asp:Table id="TableAppRecords" runat="server" >
<asp:TableRow BackColor="#990000">
<asp:TableCell>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
|