TableCellCollection Class

Provides standard facilities for creating and managing a type-safe, ordered collection of TableCell objects.

Namespace: System.Windows.Documents
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public ref class TableCellCollection sealed : IList<TableCell^>, ICollection<TableCell^>, 
	IEnumerable<TableCell^>, IList, ICollection, IEnumerable
public final class TableCellCollection implements IList<TableCell>, 
	ICollection<TableCell>, IEnumerable<TableCell>, IList, 
	ICollection, IEnumerable
public final class TableCellCollection implements IList<TableCell>, 
	ICollection<TableCell>, IEnumerable<TableCell>, IList, 
	ICollection, IEnumerable
You cannot use this managed class in XAML.

This collection supports standard zero-based indexing.

The Cells property provided by the TableRow class returns a TableCellCollection.

The following examples show how to programmatically create a Table and populate it with content. The contents of the table are apportioned into five rows (represented by TableRow objects contained in a RowGroups object) and six columns (represented by TableColumn objects). The rows are used for different presentation purposes, including a title row intended to title the entire table, a header row to describe the columns of data in the table, and a footer row with summary information. Note that the notion of "title", "header", and "footer" rows are not inherent to the table; these are simply rows with different characteristics. Table cells contain the actual content, which can be comprised of text, images, or nearly any other user interface (UI) element.

NoteNote:

For a complete sample that demonstrates the example code shown below, see Displaying Tabular Data in a Table Sample.

First, a FlowDocument is created to host the Table, and a new Table is created and added to the contents of the FlowDocument.

No code example is currently available or this language may not be supported.

Next, six TableColumn objects are created and added to the table's Columns collection, with some formatting applied.

NoteNote:

Note that the table's Columns collection uses standard zero-based indexing.

No code example is currently available or this language may not be supported.

Next, a title row is created and added to the table with some formatting applied. The title row happens to contain a single cell that spans all six columns in the table.

No code example is currently available or this language may not be supported.

Next, a header row is created and added to the table, and the cells in the header row are created and populated with content.

No code example is currently available or this language may not be supported.

Next, a row for data is created and added to the table, and the cells in this row are created and populated with content. Building this row is similar to building the header row, with slightly different formatting applied.

No code example is currently available or this language may not be supported.

Finally, a footer row is created, added, and formatted. Like the title row, the footer contains a single cell that spans all six columns in the table.

No code example is currently available or this language may not be supported.

System.Object
  System.Windows.Documents.TableCellCollection

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show: