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


Xceed.Wpf.DataGrid Assembly > Xceed.Wpf.DataGrid Namespace : MergedColumnManagerRow Class
Specialization of the ColumnManagerRow class that contains a collection of MergedColumnManagerCells that can be used to manipulate grouped (merged) columns in a grid.
Syntax
'Declaration
 
<TemplatePartAttribute(Name="PART_CellsHost", Type=System.Windows.Controls.Panel)>
<ContentPropertyAttribute("Cells")>
<StyleTypedPropertyAttribute(Property="FocusVisualStyle", StyleTargetType=System.Windows.Controls.Control)>
<XmlLangPropertyAttribute("Language")>
<UsableDuringInitializationAttribute(True)>
<RuntimeNamePropertyAttribute("Name")>
<UidPropertyAttribute("Uid")>
<TypeDescriptionProviderAttribute(MS.Internal.ComponentModel.DependencyObjectProvider)>
<NameScopePropertyAttribute("NameScope", System.Windows.NameScope)>
Public Class MergedColumnManagerRow 
   Inherits ColumnManagerRow
'Usage
 
Dim instance As MergedColumnManagerRow
[TemplatePart(Name="PART_CellsHost", Type=System.Windows.Controls.Panel)]
[ContentProperty("Cells")]
[StyleTypedProperty(Property="FocusVisualStyle", StyleTargetType=System.Windows.Controls.Control)]
[XmlLangProperty("Language")]
[UsableDuringInitialization(true)]
[RuntimeNameProperty("Name")]
[UidProperty("Uid")]
[TypeDescriptionProvider(MS.Internal.ComponentModel.DependencyObjectProvider)]
[NameScopeProperty("NameScope", System.Windows.NameScope)]
public class MergedColumnManagerRow : ColumnManagerRow 
Remarks

 

Example

The following shows how to set up merged column headers.

<xcdg:DataGridControl x:Name="grid"
                       ItemsSource="{Binding Source={StaticResource cvsTransactions}}"
                       ReadOnly="True"
                       NavigationBehavior="RowOnly">
   <xcdg:DataGridControl.Resources>
     <!-- These implicit styles that are local to this DataGridControl are an
                  elegant way to set some desired default values of various grid elements. -->
     <ResourceDictionary>
       <Style TargetType="xcdg:MergedColumnManagerRow">
         <Setter Property="AllowColumnReorder"
                 Value="{Binding ElementName=allowMergedColumnReorderCheckBox,Path=IsChecked}"/>
         <Setter Property="AllowColumnResize"
                 Value="{Binding ElementName=allowMergedColumnResizeCheckBox,Path=IsChecked}"/>
       </Style>

       <Style TargetType="xcdg:ColumnManagerRow">
         <Setter Property="AllowColumnReorder"
                 Value="{Binding ElementName=allowColumnReorderCheckBox,Path=IsChecked}"/>
         <Setter Property="AllowColumnResize"
                 Value="{Binding ElementName=allowColumnResizeCheckBox,Path=IsChecked}"/>
       </Style>
     </ResourceDictionary>
   </xcdg:DataGridControl.Resources>

   <xcdg:DataGridControl.MergedHeaders>
     <xcdg:MergedHeader>
       <xcdg:MergedHeader.MergedColumns>
         <xcdg:MergedColumn FieldName="Quarter1"
                            Title="Quarter 1"
                            CellHorizontalContentAlignment="Center"
                            ChildColumnNames="JanuarySummary,FebruarySummary,MarchSummary" />
         <xcdg:MergedColumn FieldName="Quarter2"
                            Title="Quarter 2"
                            CellHorizontalContentAlignment="Center"
                            ChildColumnNames="AprilSummary,MaySummary,JuneSummary" />
         <xcdg:MergedColumn FieldName="Quarter3"
                            Title="Quarter 3"
                            CellHorizontalContentAlignment="Center"
                            ChildColumnNames="JulySummary,AugustSummary,SeptemberSummary" />
         <xcdg:MergedColumn FieldName="Quarter4"
                            Title="Quarter 4"
                            CellHorizontalContentAlignment="Center"
                            ChildColumnNames="OctoberSummary,NovemberSummary,DecemberSummary" />
       </xcdg:MergedHeader.MergedColumns>
     </xcdg:MergedHeader>
     <xcdg:MergedHeader>
       <xcdg:MergedHeader.MergedColumns>
         <xcdg:MergedColumn FieldName="JanuarySummary"
                            Title="January Transactions"
                            CellHorizontalContentAlignment="Center"
                            ChildColumnNames="JanuaryIncome,JanuaryExpense" />
         <xcdg:MergedColumn FieldName="FebruarySummary"
                            Title="February Transactions"
                            CellHorizontalContentAlignment="Center"
                            ChildColumnNames="FebruaryIncome,FebruaryExpense" />
         <xcdg:MergedColumn FieldName="MarchSummary"
                            Title="March Transactions"
                            CellHorizontalContentAlignment="Center"
                            ChildColumnNames="MarchIncome,MarchExpense" />
         <xcdg:MergedColumn FieldName="AprilSummary"
                            Title="April Transactions"
                            CellHorizontalContentAlignment="Center"
                            ChildColumnNames="AprilIncome,AprilExpense" />
         <xcdg:MergedColumn FieldName="MaySummary"
                            Title="May Transactions"
                            CellHorizontalContentAlignment="Center"
                            ChildColumnNames="MayIncome,MayExpense" />
         <xcdg:MergedColumn FieldName="JuneSummary"
                            Title="June Transactions"
                            CellHorizontalContentAlignment="Center"
                            ChildColumnNames="JuneIncome,JuneExpense" />
         <xcdg:MergedColumn FieldName="JulySummary"
                            Title="July Transactions"
                            CellHorizontalContentAlignment="Center"
                            ChildColumnNames="JulyIncome,JulyExpense" />
         <xcdg:MergedColumn FieldName="AugustSummary"
                            Title="August Transactions"
                            CellHorizontalContentAlignment="Center"
                            ChildColumnNames="AugustIncome,AugustExpense" />
         <xcdg:MergedColumn FieldName="SeptemberSummary"
                            Title="September Transactions"
                            CellHorizontalContentAlignment="Center"
                            ChildColumnNames="SeptemberIncome,SeptemberExpense" />
         <xcdg:MergedColumn FieldName="OctoberSummary"
                            Title="October Transactions"
                            CellHorizontalContentAlignment="Center"
                            ChildColumnNames="OctoberIncome,OctoberExpense" />
         <xcdg:MergedColumn FieldName="NovemberSummary"
                            Title="November Transactions"
                            CellHorizontalContentAlignment="Center"
                            ChildColumnNames="NovemberIncome,NovemberExpense" />
         <xcdg:MergedColumn FieldName="DecemberSummary"
                            Title="December Transactions"
                            CellHorizontalContentAlignment="Center"
                            ChildColumnNames="DecemberIncome,DecemberExpense" />
       </xcdg:MergedHeader.MergedColumns>
     </xcdg:MergedHeader>
   </xcdg:DataGridControl.MergedHeaders>

   <xcdg:DataGridControl.Columns>
     <xcdg:Column FieldName="JanuaryIncome"
                  Title="Income"
                  CellContentTemplate="{StaticResource currencyCellDataTemplate}" />

     <xcdg:Column FieldName="JanuaryExpense"
                  Title="Expense"
                  CellContentTemplate="{StaticResource currencyCellDataTemplate}" />

     <xcdg:Column FieldName="FebruaryIncome"
                  Title="Income"
                  CellContentTemplate="{StaticResource currencyCellDataTemplate}" />

     <xcdg:Column FieldName="FebruaryExpense"
                  Title="Expense"
                  CellContentTemplate="{StaticResource currencyCellDataTemplate}" />

     <xcdg:Column FieldName="MarchIncome"
                  Title="Income"
                  CellContentTemplate="{StaticResource currencyCellDataTemplate}" />

     <xcdg:Column FieldName="MarchExpense"
                  Title="Expense"
                  CellContentTemplate="{StaticResource currencyCellDataTemplate}" />

     <xcdg:Column FieldName="AprilIncome"
                  Title="Income"
                  CellContentTemplate="{StaticResource currencyCellDataTemplate}" />

     <xcdg:Column FieldName="AprilExpense"
                  Title="Expense"
                  CellContentTemplate="{StaticResource currencyCellDataTemplate}" />

     <xcdg:Column FieldName="MayIncome"
                  Title="Income"
                  CellContentTemplate="{StaticResource currencyCellDataTemplate}" />

     <xcdg:Column FieldName="MayExpense"
                  Title="Expense"
                  CellContentTemplate="{StaticResource currencyCellDataTemplate}" />

     <xcdg:Column FieldName="JuneIncome"
                  Title="Income"
                  CellContentTemplate="{StaticResource currencyCellDataTemplate}" />

     <xcdg:Column FieldName="JuneExpense"
                  Title="Expense"
                  CellContentTemplate="{StaticResource currencyCellDataTemplate}" />

     <xcdg:Column FieldName="JulyIncome"
                  Title="Income"
                  CellContentTemplate="{StaticResource currencyCellDataTemplate}" />

     <xcdg:Column FieldName="JulyExpense"
                  Title="Expense"
                  CellContentTemplate="{StaticResource currencyCellDataTemplate}" />

     <xcdg:Column FieldName="AugustIncome"
                  Title="Income"
                  CellContentTemplate="{StaticResource currencyCellDataTemplate}" />

     <xcdg:Column FieldName="AugustExpense"
                  Title="Expense"
                  CellContentTemplate="{StaticResource currencyCellDataTemplate}" />

     <xcdg:Column FieldName="SeptemberIncome"
                  Title="Income"
                  CellContentTemplate="{StaticResource currencyCellDataTemplate}" />

     <xcdg:Column FieldName="SeptemberExpense"
                  Title="Expense"
                  CellContentTemplate="{StaticResource currencyCellDataTemplate}" />

     <xcdg:Column FieldName="OctoberIncome"
                  Title="Income"
                  CellContentTemplate="{StaticResource currencyCellDataTemplate}" />

     <xcdg:Column FieldName="OctoberExpense"
                  Title="Expense"
                  CellContentTemplate="{StaticResource currencyCellDataTemplate}" />

     <xcdg:Column FieldName="NovemberIncome"
                  Title="Income"
                  CellContentTemplate="{StaticResource currencyCellDataTemplate}" />

     <xcdg:Column FieldName="NovemberExpense"
                  Title="Expense"
                  CellContentTemplate="{StaticResource currencyCellDataTemplate}" />

     <xcdg:Column FieldName="DecemberIncome"
                  Title="Income"
                  CellContentTemplate="{StaticResource currencyCellDataTemplate}" />

     <xcdg:Column FieldName="DecemberExpense"
                  Title="Expense"
                  CellContentTemplate="{StaticResource currencyCellDataTemplate}" />

   </xcdg:DataGridControl.Columns>

   <xcdg:DataGridControl.View>
     <!-- In this sample, you can define this resource to specify the default
                  theme this DataGridControl will be in. This is not mandatory, so we
                  use a DynamicResource to silently ignore its absence. -->
     <xcdg:TableflowView Theme="{DynamicResource defaultTheme}"
                         AllowColumnChooser="{Binding Source={x:Static local:ConfigurationData.Singleton}, Path=AllowColumnChooser}"
                         ShowFixedColumnSplitter="{Binding Source={x:Static local:ConfigurationData.Singleton}, Path=ShowFixedColumnSplitter}" />
   </xcdg:DataGridControl.View>

 </xcdg:DataGridControl>
Inheritance Hierarchy

System.Object
   System.Windows.Threading.DispatcherObject
      System.Windows.DependencyObject
         System.Windows.Media.Visual
            System.Windows.UIElement
               System.Windows.FrameworkElement
                  System.Windows.Controls.Control
                     Xceed.Wpf.DataGrid.Row
                        Xceed.Wpf.DataGrid.ColumnManagerRow
                           Xceed.Wpf.DataGrid.MergedColumnManagerRow

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

MergedColumnManagerRow Members
Xceed.Wpf.DataGrid Namespace