Files
docs-desktop/dotnet-desktop-guide/framework/wpf/advanced/how-to-manipulate-table-row-groups-through-the-rowgroups-property.md
T
Andy De George da363692ff Initial WPF content migrated (#17)
* Reset branch for WPF changes

* Convert BMP to PNG; fix link-out-of-scope err

* Add snippets for WPF... 6794 files!!!!

* Add missing snippets

* update file updated between migration

* Fix paths to include

* update breadcrumb and toc

* fix index links

* fix index links

* fix index links

* fix markdown
2020-09-04 09:46:28 -07:00

5.9 KiB

title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title ms.date dev_langs helpviewer_keywords ms.assetid
How to: Manipulate a Table's Row Groups through the RowGroups Property 03/30/2017
csharp
vb
row groups [WPF], manipulating through RowGroups property
RowGroups property [WPF], manipulating row groups
documents [WPF], manipulating row groups through RowGroups property
properties [WPF], RowGroups [WPF], manipulating row groups
ea61440f-08ae-44ed-b314-5716aaaae3ed

How to: Manipulate a Table's Row Groups through the RowGroups Property

This example demonstrates some of the more common operations that can be performed on a table's row groups through the xref:System.Windows.Documents.Table.RowGroups%2A property.

Example

The following example creates a new table and then uses the xref:System.Windows.Documents.TableRowGroupCollection.Add%2A method to add columns to the table's xref:System.Windows.Documents.Table.RowGroups%2A collection.

[!code-csharpTableSnippets2#_Table_RowGroups_Add] [!code-vbTableSnippets2#_Table_RowGroups_Add]

Example

The following example inserts a new xref:System.Windows.Documents.TableRowGroup. The new column is inserted at index position 0, making it the new first row group in the table.

Note

The xref:System.Windows.Documents.TableRowGroupCollection collection uses standard zero-based indexing.

[!code-csharpTableSnippets2#_Table_RowGroups_Insert] [!code-vbTableSnippets2#_Table_RowGroups_Insert]

Example

The following example adds several rows to a particular xref:System.Windows.Documents.TableRowGroup (specified by index) in the table.

[!code-csharpTableSnippets2#_Table_RowGroups_AddRows] [!code-vbTableSnippets2#_Table_RowGroups_AddRows]

Example

The following example accesses some arbitrary properties on rows in the first row group in the table.

[!code-csharpTableSnippets2#_Table_RowGroups_ManipRows] [!code-vbTableSnippets2#_Table_RowGroups_ManipRows]

Example

The following example adds several cells to a particular xref:System.Windows.Documents.TableRow (specified by index) in the table.

[!code-csharpTableSnippets2#_Table_RowGroups_AddCells] [!code-vbTableSnippets2#_Table_RowGroups_AddCells]

Example

The following example access some arbitrary methods and properties on cells in the first row in the first row group.

[!code-csharpTableSnippets2#_Table_RowGroups_ManipCells] [!code-vbTableSnippets2#_Table_RowGroups_ManipCells]

Example

The following example returns the number of xref:System.Windows.Documents.TableRowGroup elements hosted by the table.

[!code-csharpTableSnippets2#_Table_RowGroups_Count] [!code-vbTableSnippets2#_Table_RowGroups_Count]

Example

The following example removes a particular row group by reference.

[!code-csharpTableSnippets2#_Table_RowGroups_DelRef] [!code-vbTableSnippets2#_Table_RowGroups_DelRef]

Example

The following example removes a particular row group by index.

[!code-csharpTableSnippets2#_Table_RowGroups_DelIndex] [!code-vbTableSnippets2#_Table_RowGroups_DelIndex]

Example

The following example removes all row groups from the table's row groups collection.

[!code-csharpTableSnippets2#_Table_RowGroups_Clear] [!code-vbTableSnippets2#_Table_RowGroups_Clear]

See also