Expands data grid row groups.
Assembly: System.Windows.Controls.Data (in System.Windows.Controls.Data.dll)
'Declaration Public Sub ExpandRowGroup ( _ collectionViewGroup As CollectionViewGroup, _ expandAllSubgroups As Boolean _ )
You can call this method to programmatically expand row groups in a DataGrid control that contains grouped data. You can use the GetGroupFromItem method to get the particular group that a specified item belongs to. Alternatively, you can iterate through the Groups collection to expand all row groups.
The following example demonstrates how to expand all row groups in a DataGrid control. This example is part of a larger example available in the How to: Group, Sort, and Filter Data in the DataGrid Control topic.
Private Sub ExpandButton_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Dim pcv As PagedCollectionView = Me.dataGrid1.ItemsSource Try For Each group As CollectionViewGroup In pcv.Groups dataGrid1.ExpandRowGroup(group, True) Next Catch ex As Exception ' Could not expand group. MessageBox.Show(ex.Message) End Try End Sub
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.