asp.net.ph

HtmlTableCellCollection.RemoveAt Method

System.Web.UI.HtmlControls Namespace   HtmlTableCellCollection Class


Removes the table cell at the specified index from the Cells collection.

[ VB ]
Public Sub RemoveAt ( _
   ByVal index As Integer _
) 

[ C# ]
public void RemoveAt (
   int index
);

[ C++ ]
public: void RemoveAt (
   int index
);

[ JScript ]
public function RemoveAt (
   index : int
);

Parameters

index
The index of the table cell to be removed.

Remarks

Use this method to remove the HtmlTableCell at the specified index from an HtmlTableCellCollection. The index number is zero-based; therefore, the first item in the collection has an index value of 0.

NOTE: An ArgumentOutOfRangeException is raised if you specify an index that is outside the range of index values in the collection.

Example

The following example demonstrates how to use the RemoveAt method to remove the cells from the first column of an HtmlTable.

// iterate through the rows of the table
for ( int row = 0; row <= myTable.Rows.Count - 1; row++ ) {
   // remove the cell from the first column
   myTable.Rows [ row ].Cells.RemoveAt ( 0 );
}

 Show me 

See Also

HtmlTableCellCollection Members   Cells.Remove   Cells.Clear Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph