TableRowCollection.Count Property
.NET Framework 3.0
Gets the number of TableRow objects in the TableRowCollection.
Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
The following example demonstrates how to use the Count property to determine the number of rows in the TableRowCollection. Note that in the example, the Rows property of the Table is an instance of the TableRowCollection class.
void Button_Click_Coord(Object sender, EventArgs e)
{
for (int rowNum = 0; rowNum < table1.get_Rows().get_Count(); rowNum++)
{
for (int cellNum = 0;
cellNum < table1.get_Rows().get_Item(rowNum).get_Cells().get_Count();
cellNum++)
{
table1.get_Rows().get_Item(rowNum).get_Cells().get_Item(cellNum).
set_Text( "(" + System.Convert.ToString(rowNum) + ", "
+ System.Convert.ToString(cellNum) + ")");
}
}
} //Button_Click_Coord
Community Additions
ADD
Show: