Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace: http://schemas.microsoft.com/winfx/2006/xaml/presentation
Property ValueA TableRowGroupCollection collection object that contains the row groups (represented by TableRowGroup objects) hosted by the table. This property has no default value.
This example demonstrates some of the more common operations that can be performed on a table's row groups through the RowGroups property.
The following example creates a new table and then uses the Add method to add columns to the table's RowGroups collection.
Table tbl = new Table(); int rowGroupsToAdd = 4; for (int x = 0; x < rowGroupsToAdd; x++) tbl.RowGroups.Add(new TableRowGroup());
The following example inserts a new TableRowGroup. The new column is inserted at index position 0, making it the new first row group in the table.
The TableRowGroupCollection collection uses standard zero-based indexing.
The following example adds several rows to a particular TableRowGroup (specified by index) in the table.
int rowsToAdd = 10; for (int x = 0; x < rowsToAdd; x++) tbl.RowGroups.Rows.Add(new TableRow());
The following example accesses some arbitrary properties on rows in the first row group in the table.
// Alias the working TableRowGroup for ease in referencing. TableRowGroup trg = tbl.RowGroups; trg.Rows.Background = Brushes.CornflowerBlue; trg.Rows.FontSize = 24; trg.Rows.ToolTip = "This row's tooltip";
The following example adds several cells to a particular TableRow (specified by index) in the table.
int cellsToAdd = 10; for (int x = 0; x < cellsToAdd; x++) tbl.RowGroups.Rows.Cells.Add(new TableCell(new Paragraph(new Run("Cell " + (x + 1)))));
The following example access some arbitrary methods and properties on cells in the first row in the first row group.
// Alias the working for for ease in referencing. TableRow row = tbl.RowGroups.Rows; row.Cells.Background = Brushes.PapayaWhip; row.Cells.FontStyle = FontStyles.Italic; // This call clears all of the content from this cell. row.Cells.Blocks.Clear();
The following example returns the number or TableRowGroup elements hosted by the table.
The following example removes a particular row group by reference.
The following example removes a particular row group by index.
The following example removes all row groups from the table's row groups collection.
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 EditionThe Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.