We would like to remove all of the the headers and rows of an ASP.Net asp:Table that was populated at run time and is now currently being displayed on a web form.
Can this be done?
Please show code-behind coding that will do this if it can be done.
Are you looking for TableRowCollection.Clear
?
table.Rows.Clear()
This will remove all TableRow
s (incl. TableHeaderRow
and TableFooterRow
) from the table.