Xceed.Silverlight.DataGrid.v2.0 Assembly > Xceed.Silverlight.DataGrid Namespace > DataGridControl Class : DefaultGroupConfiguration Property |
'Declaration Public Property DefaultGroupConfiguration As DataGridGroupConfiguration
'Usage Dim instance As DataGridControl Dim value As DataGridGroupConfiguration instance.DefaultGroupConfiguration = value value = instance.DefaultGroupConfiguration
public DataGridGroupConfiguration DefaultGroupConfiguration {get; set;}
<sldg:DataGridControl x:Name="sldgDataGridControl" ItemsSource="{Binding Path=Orders}"> <sldg:DataGridControl.GroupDescriptions> <sldg:DataGridGroupDescription PropertyName="ShipCity"/> </sldg:DataGridControl.GroupDescriptions> <sldg:DataGridControl.DefaultGroupConfiguration> <sldg:DataGridGroupConfiguration> <sldg:DataGridGroupConfiguration.Footers> <DataTemplate> <Button Content="Select Items in Group" Click="SelectGroupItems_Click" Tag="{Binding}"/> </DataTemplate> </sldg:DataGridGroupConfiguration.Footers> </sldg:DataGridGroupConfiguration> </sldg:DataGridControl.DefaultGroupConfiguration> </sldg:DataGridControl>
Private Sub SelectGroupItems_Click( ByVal sender As Object, ByVal e As RoutedEventArgs ) Dim context As GroupHeaderFooterContext = CType( CType( sender, Button ).Tag, GroupHeaderFooterContext ) If Not context Is Nothing Then Dim propertyName As String = CType( context.GroupDescription, DataGridGroupDescription ).PropertyName Dim range As New SelectionRange( New SortDescription() { New SortDescription( propertyName, ListSortDirection.Ascending ) }, Nothing, Nothing ) range.StartRangeInfos.Add( propertyName, context.GroupValue ) range.EndRangeInfos.Add( propertyName, context.GroupValue ) Me.sldgDataGridControl.SelectedRanges.Clear() Me.sldgDataGridControl.SelectedRanges.Add( range ) End If End Sub
private void SelectGroupItems_Click( object sender, RoutedEventArgs e ) { GroupHeaderFooterContext context = ( ( Button )sender ).Tag as GroupHeaderFooterContext; if( context != null ) { string propertyName = ( ( DataGridGroupDescription )context.GroupDescription ).PropertyName; SelectionRange range = new SelectionRange( new SortDescription[] { new SortDescription( propertyName, ListSortDirection.Ascending ) }, null, null ); range.StartRangeInfos.Add( propertyName, context.GroupValue ); range.EndRangeInfos.Add( propertyName, context.GroupValue ); this.sldgDataGridControl.SelectedRanges.Clear(); this.sldgDataGridControl.SelectedRanges.Add( range ); } }
Target Platforms: Windows 7, Windows Vista, Windows XP SP3, Windows Server 2008 family