Xceed DataGrid for WPF v7.2 Documentation
RegionConfiguration Class
Members  Example 


Xceed.Wpf.DataGrid Assembly > Xceed.Wpf.DataGrid.Views.Surfaces Namespace : RegionConfiguration Class
Class that determines how the content of a region presenter is displayed (see Remarks).
Syntax
'Declaration
 
<TypeDescriptionProviderAttribute(MS.Internal.ComponentModel.DependencyObjectProvider)>

<NameScopePropertyAttribute("NameScope", System.Windows.NameScope)>

Public Class RegionConfiguration 

   Inherits System.Windows.DependencyObject
'Usage
 
Dim instance As RegionConfiguration
[TypeDescriptionProvider(MS.Internal.ComponentModel.DependencyObjectProvider)]

[NameScopeProperty("NameScope", System.Windows.NameScope)]

public class RegionConfiguration : System.Windows.DependencyObject 
Remarks

Each base surface configuration (see Table 1 in Surface Configurations) supports various regions (title, image, and/or data) that display information from the fields in a data item and that can be configured through their corresponding region-configuration properties. The "complete" surface configuration displays all 3 three regions (see Figure 1), while the title, image, and data surface configurations display only their respective regions. The other surface configurations display combinations of these regions.


Figure 1: CompleteSurfaceConfiguration regions in Elemental Black theme

Example

All examples in this topic assume that the grid is bound to the Employees table of the Northwind database, unless stated otherwise

The following example demonstrates how to provide a default title-region configuration that will be used by all surfaces that display a title.
<Grid xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid">

  <Grid.Resources>

   <xcdg:DataGridCollectionViewSource x:Key="cvs_employees"

                                   Source="{Binding Source={x:Static Application.Current}, Path=EmployeesTable}"/>

 

  </Grid.Resources>

 

  <xcdg:DataGridControl x:Name="EmployeesGrid"

                      ItemsSource="{Binding Source={StaticResource cvs_employees}}">

 

   <xcdg:DataGridControl.View>

      <xcdg:CardflowView3D>

         <xcdg:CardflowView3D.Theme>

            <xcdg:ElementalBlackTheme>



              <!-- The DefaultTitleRegionConfiguration will be applied to all title regions in all surfaces

                   for which a RegionConfiguration has not been explicitly provided. -->

              <xcdg:ElementalBlackTheme.DefaultTitleRegionConfiguration>

                 <xcdg:RegionConfiguration FieldNames="TitleOfCourtesy, FirstName, LastName, Title"

                                           ReadOnly="True">

                    <xcdg:RegionConfiguration.Template>

                       <DataTemplate>

                          <Viewbox>

                             <StackPanel>

                                <StackPanel Orientation="Horizontal"

                                            HorizontalAlignment="Center">

                                   <StackPanel.Resources>

                                      <Style TargetType="{x:Type xcdg:DataCell}">

                                         <Setter Property="Margin"

                                                 Value="0, 0, 3, 0"/>

                                      </Style>

                                   </StackPanel.Resources>

                                   <xcdg:DataCell FieldName="TitleOfCourtesy"/>

                                   <xcdg:DataCell FieldName="FirstName"/>

                                   <xcdg:DataCell FieldName="LastName"/>

                                </StackPanel>

                                <xcdg:DataCell FieldName="Title"

                                               TextElement.FontSize="10"

                                               HorizontalContentAlignment="Center"/>

                             </StackPanel>

                          </Viewbox>

                       </DataTemplate>

                    </xcdg:RegionConfiguration.Template>

                 </xcdg:RegionConfiguration>

              </xcdg:ElementalBlackTheme.DefaultTitleRegionConfiguration>

            </xcdg:ElementalBlackTheme>

         </xcdg:CardflowView3D.Theme>

      </xcdg:CardflowView3D>

    </xcdg:DataGridControl.View>

  </xcdg:DataGridControl>

</Grid>
Inheritance Hierarchy

System.Object
   System.Windows.Threading.DispatcherObject
      System.Windows.DependencyObject
         Xceed.Wpf.DataGrid.Views.Surfaces.RegionConfiguration

Requirements

Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

RegionConfiguration Members
Xceed.Wpf.DataGrid.Views.Surfaces Namespace

DataGrid Fundamentals

Surface Configurations