asp.net - Coloring dynamically created table row without Javascript -
dim table1 new htmltable table1.border = "1" table1.bordercolor = "blue" j integer = 0 2 dim row new htmltablerow() dim cell1 new htmltablecell() dim cell2 new htmltablecell() dim rbl new radiobuttonlist() rowindex integer = 0 2 rbl.id = rowindex rbl.items.add("hi") dim lbl1 new label() lbl1.id = "hi" + rowindex.tostring lbl1.text = "hello" lbl1.height = "25" cell2.controls.add(lbl1) cell2.controls.add(new literalcontrol("<br />")) next cell1.controls.add(rbl) row.cells.add(cell1) row.cells.add(cell2) table1.rows.add(row) next placeholder1.controls.add(table1)
in above code border appears rows , cell , whole table, need border should appear only row , not in cells.
edit when added line row color works
row.attributes.add("style", "outline: thin solid blue;")
but line diappears on double click inside table..!!
you can try outline
style row.
you need add using attributes.add()
method.
remove border setting table1
see complete code below:
dim table1 new htmltable 'table1.border = "1" 'table1.bordercolor = "blue" j integer = 0 2 dim row new htmltablerow() dim cell1 new htmltablecell() dim cell2 new htmltablecell() dim rbl new radiobuttonlist() row.attributes.add("style", "outline: thin solid blue;") rowindex integer = 0 2 rbl.id = rowindex rbl.items.add("hi") dim lbl1 new label() lbl1.id = "hi" + rowindex.tostring lbl1.text = "hello" lbl1.height = "25" cell2.controls.add(lbl1) 'add cell2.controls.add(new literalcontrol("<br />")) next cell1.controls.add(rbl) row.cells.add(cell1) row.cells.add(cell2) table1.rows.add(row) next placeholder1.controls.add(table1)
Comments
Post a Comment