Saturday, March 31, 2012

table server control -- make column invisible

I have a table server control (System.Web.UI.WebControls.Table) on my form
that has three columns. Sometimes I need the second column to be invisible,
sometimes the third. How can I set a column to be invisible in code? There
appears to not be a programmatic way to work with columns in the way that
there is rows.

Thanks.

--SusanI don't think there a Column Visible property for the WebControls.Table object. So you may have to handle this on your own

For example
foreach(TableRow tr in myTable.Rows

tr.Cells[yourcolumnindex].Visible = false

HTH
Suresh

-- Susan Geller wrote: --

I have a table server control (System.Web.UI.WebControls.Table) on my for
that has three columns. Sometimes I need the second column to be invisible
sometimes the third. How can I set a column to be invisible in code? Ther
appears to not be a programmatic way to work with columns in the way tha
there is rows

Thanks

--Susa

0 comments:

Post a Comment