xceed wpf datagrid
<!--*********************************************************************************** Extended WPF Toolkit Copyright (C) - Xceed Software Inc. This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license For more features, controls, and fast professional support,
pick up the Plus Edition at http://xceed.com/wpf_toolkit Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids **********************************************************************************--> <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Xceed.Wpf.DataGrid"
xmlns:markup="clr-namespace:Xceed.Wpf.DataGrid.Markup"
xmlns:conv="clr-namespace:Xceed.Wpf.DataGrid.Converters"
xmlns:views="clr-namespace:Xceed.Wpf.DataGrid.Views"> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Common.Resources.xaml" />
</ResourceDictionary.MergedDictionaries> <Style x:Key="tableflowViewRowFocusVisualStyle"
TargetType="IFrameworkInputElement">
<Style.Resources>
<conv:ThicknessConverter x:Key="thicknessConverter" />
</Style.Resources> <Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Stroke="#FF000000"
StrokeThickness=""
StrokeDashArray="1 2"
Margin="{Binding RelativeSource={RelativeSource AncestorType={x:Type ScrollViewer}}, Path=HorizontalOffset, Converter={StaticResource thicknessConverter}, ConverterParameter='Left'}"
SnapsToDevicePixels="True" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style> <conv:ThicknessConverter x:Key="inverseThicknessConverter"
InverseValue="True" /> <!--**************************
* TEMPLATE: DataGridControl
************************** -->
<ControlTemplate x:Key="tableflowViewDataGridControlTemplate"
TargetType="local:DataGridControl">
<Grid>
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"> <!-- The AdornerDecorator will allow visual cues for Drag & Drop operations. -->
<AdornerDecorator x:Name="PART_DragDropAdornerDecorator">
<!-- The TableViewScrollViewer takes care of laying out the various sections of
a DataGrid in TableflowView: FixedHeaders, FixedFooters, RowSelectorPane, etc. -->
<views:TableViewScrollViewer x:Name="PART_ScrollViewer"
ShowRowSelectorPane="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).ShowRowSelectorPane}"
RowSelectorPaneWidth="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).RowSelectorPaneWidth}"
Padding="{TemplateBinding Padding}"> <views:TableflowViewItemsHost /> </views:TableViewScrollViewer>
</AdornerDecorator>
</Border>
<Grid x:Name="connectionStateGrid"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Margin="0,0,25,25"
Height=""
Width="">
<ContentPresenter x:Name="connectionStateLoadingContentPresenter"
ContentTemplate="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).ConnectionStateLoadingGlyph}"
Content="{TemplateBinding ConnectionState}"
Visibility="Collapsed" />
<ContentPresenter x:Name="connectionStateCommittingContentPresenter"
ContentTemplate="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).ConnectionStateCommittingGlyph}"
Content="{TemplateBinding ConnectionState}"
Visibility="Collapsed" />
<ContentPresenter x:Name="connectionStateErrorContentPresenter"
ContentTemplate="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).ConnectionStateErrorGlyph}"
Content="{TemplateBinding ConnectionState}"
Visibility="Collapsed" />
</Grid>
</Grid>
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).IsConnectionStateGlyphEnabled}"
Value="False">
<Setter TargetName="connectionStateGrid"
Property="Visibility"
Value="Collapsed" />
</DataTrigger>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).DataGridControl.ConnectionState}"
Value="Loading">
<Setter TargetName="connectionStateLoadingContentPresenter"
Property="Visibility"
Value="Visible" />
<Setter TargetName="connectionStateErrorContentPresenter"
Property="Visibility"
Value="Collapsed" />
<Setter TargetName="connectionStateCommittingContentPresenter"
Property="Visibility"
Value="Collapsed" />
</DataTrigger>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).DataGridControl.ConnectionState}"
Value="Committing">
<Setter TargetName="connectionStateLoadingContentPresenter"
Property="Visibility"
Value="Collapsed" />
<Setter TargetName="connectionStateErrorContentPresenter"
Property="Visibility"
Value="Collapsed" />
<Setter TargetName="connectionStateCommittingContentPresenter"
Property="Visibility"
Value="Visible" />
</DataTrigger>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).DataGridControl.ConnectionState}"
Value="Error">
<Setter TargetName="connectionStateLoadingContentPresenter"
Property="Visibility"
Value="Collapsed" />
<Setter TargetName="connectionStateErrorContentPresenter"
Property="Visibility"
Value="Visible" />
<Setter TargetName="connectionStateCommittingContentPresenter"
Property="Visibility"
Value="Collapsed" />
</DataTrigger> </ControlTemplate.Triggers>
</ControlTemplate> <!--**************************
* TEMPLATE: RowSelector
************************** -->
<ControlTemplate x:Key="tableflowViewRowSelectorTemplate"
TargetType="local:RowSelector"> <!-- This Grid is used to position the resizer Thumb over the RowSelector -->
<Grid> <Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}"> <ContentPresenter x:Name="contentPresenter"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Border> <!-- Thumb that is used to resize the Row. -->
<Thumb x:Name="PART_RowResizerThumb"
Style="{StaticResource invisibleThumbStyle}"
VerticalAlignment="Bottom" /> </Grid>
</ControlTemplate> <!--**************************
* TEMPLATE: Row
************************** -->
<ControlTemplate x:Key="tableflowViewRowTemplate"
TargetType="local:Row"> <!-- A basic Row Template requires at least a Panel named "PART_CellsHost" to which the Row's cells will be added.
This Panel is usually placed inside a Border who is responsible for painting the gridlines. -->
<ControlTemplate.Resources>
<conv:TypeToBooleanConverter x:Key="typeToBooleanConverter" />
</ControlTemplate.Resources> <!-- This Grid is used to layout the GroupLevelIndicatorPane placeholder and the CellsHost panel. -->
<Grid x:Name="rootGrid">
<Grid.ColumnDefinitions>
<!-- HierarchicalGroupLevelIndicatorPane -->
<ColumnDefinition Width="Auto" />
<!-- GroupLevelIndicatorPane -->
<ColumnDefinition Width="Auto" />
<!-- MasterDetail ToggleButton -->
<ColumnDefinition Width="Auto" /> <!-- CellsHost panel -->
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> <!-- The border responsible for the visual outline of the row (gridlines and background)
spans the GroupLevelIndicatorPane and CellsHost Panel. Those elements are not children of
the Border because we don't want the border to be displayed in the GroupLevelIndicatorPane. -->
<Border x:Name="rootBorder"
Grid.Column=""
Grid.ColumnSpan=""
views:TableView.CanScrollHorizontally="False"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}" /> <local:HierarchicalGroupLevelIndicatorPane Grid.Column=""
views:TableView.CanScrollHorizontally="False" /> <!-- GroupLevelIndicatorPane is a placeholder for individual GroupLevelIndicator elements that are added
whenever this Row is part of a group. -->
<local:GroupLevelIndicatorPane x:Name="groupLevelIndicatorPane"
views:TableView.CanScrollHorizontally="False"
Grid.Column="" /> <!-- ToggleButton that is used to expand/collapse the group. -->
<Button x:Name="detailsToggle"
Template="{StaticResource detailsExpanderButtonTemplate}"
VerticalAlignment="Top"
Grid.Column=""
Margin="2,4,2,0"
Command="{x:Static local:DataGridCommands.ToggleDetailExpansion}"
OverridesDefaultStyle="True"
Focusable="False"
Visibility="Collapsed"
views:TableView.CanScrollHorizontally="False" /> <!-- This TextBlock is used to ensure that the DesiredSize for
the Row will never fall below the Height of a String using the inherited font size and face-->
<TextBlock Text=""
Visibility="Hidden"
Grid.Column=""
Margin="{TemplateBinding BorderThickness}" /> <!-- The PART_CellsHost part designates the Panel to which this Row's Cells should be added.-->
<views:FixedCellPanel x:Name="PART_CellsHost"
Grid.Column=""
ColumnStretchMinWidth="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).ColumnStretchMinWidth}"
ColumnStretchMode="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).ColumnStretchMode}"
FixedCellCount="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).FixedColumnCount, Mode=TwoWay}"
FixedColumnDropMarkPen="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).FixedColumnDropMarkPen}"
Margin="{TemplateBinding BorderThickness}" />
</Grid> <ControlTemplate.Triggers> <!-- When changing the appearance (e.g. background/foreground) of the Row to reflect specific
states (e.g. IsSelected), it is recommended to apply the changes directly to the template
elements because we want those modifications to be effective even when a value has been
explicitely set to these properties on the TemplatedParent. Also, when someone queries
the value of these properties on the TemplatedParent, we don't want to return the
intermediate, state-specific values. --> <!-- When the Row is Selected, we want to change its background/foreground to the appropriate brushes. -->
<MultiDataTrigger>
<MultiDataTrigger.Conditions> <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=IsSelected}"
Value="True" /> <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).DataGridControl.IsKeyboardFocusWithin}"
Value="True" /> </MultiDataTrigger.Conditions> <Setter TargetName="rootBorder"
Property="Background"
Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=SelectionBackground}" /> <Setter TargetName="rootGrid"
Property="TextElement.Foreground"
Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=SelectionForeground}" /> </MultiDataTrigger> <!-- When the Row is Selected but the parent DataGridControl is not focused, we want to change
the Row's background/foreground to the appropriate brushes. -->
<MultiDataTrigger>
<MultiDataTrigger.Conditions> <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=IsSelected}"
Value="True" /> <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).DataGridControl.IsKeyboardFocusWithin}"
Value="False" /> <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).DataGridControl.HideSelection}"
Value="False" /> </MultiDataTrigger.Conditions> <Setter TargetName="rootBorder"
Property="Background"
Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=InactiveSelectionBackground}" /> <Setter TargetName="rootGrid"
Property="TextElement.Foreground"
Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=InactiveSelectionForeground}" /> </MultiDataTrigger> <!-- When there are details, display the Toggle button for the expansion, collapsing of the details -->
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).HasDetails}"
Value="True" />
<Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).AllowDetailToggle}"
Value="True" />
<Condition Value="True"
Binding="{Binding RelativeSource={RelativeSource Self}, Path=., Mode=OneWay, Converter={StaticResource typeToBooleanConverter}, ConverterParameter={x:Type local:DataRow}}" />
</MultiDataTrigger.Conditions> <Setter TargetName="detailsToggle"
Property="Visibility"
Value="Visible" /> </MultiDataTrigger> <MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).HasDetails}"
Value="True" />
<Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).AllowDetailToggle}"
Value="True" />
<Condition Value="False"
Binding="{Binding RelativeSource={RelativeSource Self}, Path=., Mode=OneWay, Converter={StaticResource typeToBooleanConverter}, ConverterParameter={x:Type local:DataRow}}" />
</MultiDataTrigger.Conditions> <Setter TargetName="detailsToggle"
Property="Visibility"
Value="Hidden" /> </MultiDataTrigger>
</ControlTemplate.Triggers> </ControlTemplate> <!--**************************
* TEMPLATE: ColumnManagerRow
************************** -->
<ControlTemplate x:Key="tableflowViewColumnManagerRowTemplate"
TargetType="local:ColumnManagerRow"> <!-- A basic Row Template requires at least a Panel named "PART_CellsHost" to which the Row's cells will be added.
This Panel is usually placed inside a Border who is responsible for painting the gridlines. --> <ControlTemplate.Resources>
<conv:ThicknessConverter x:Key="thicknessConverter"
InverseValue="True" />
</ControlTemplate.Resources> <!-- This Grid is used to layout the GroupLevelIndicatorPane placeholder and the CellsHost panel. -->
<Grid x:Name="rootGrid">
<Grid.ColumnDefinitions>
<!-- HierarchicalGroupLevelIndicatorPane -->
<ColumnDefinition Width="Auto" />
<!-- GroupLevelIndicatorPane -->
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" /> <!-- CellsHost panel -->
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> <!-- The border responsible for the visual outline of the row (gridlines and background)
spans the GroupLevelIndicatorPane and CellsHost Panel. Those elements are not children of
the Border because we don't want the border to be displayed in the GroupLevelIndicatorPane. -->
<Border x:Name="rootBorder"
Grid.Column=""
Grid.ColumnSpan=""
views:TableView.CanScrollHorizontally="False"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}" /> <!-- GroupLevelIndicatorPane is a placeholder for individual GroupLevelIndicator elements that are added
whenever this Row is part of a group. -->
<local:HierarchicalGroupLevelIndicatorPane views:TableView.CanScrollHorizontally="False"
Grid.Column=""
Background="{TemplateBinding Background}" />
<local:GroupLevelIndicatorPane x:Name="groupLevelIndicatorPane"
views:TableView.CanScrollHorizontally="False"
Grid.Column=""
Background="{TemplateBinding Background}" /> <!-- ToggleButton that is used to expand/collapse the group. -->
<Button x:Name="detailsToggle"
Template="{StaticResource detailsExpanderButtonTemplate}"
VerticalAlignment="Top"
Grid.Column=""
Margin="2,4,2,0"
Command="{x:Static local:DataGridCommands.ToggleDetailExpansion}"
OverridesDefaultStyle="True"
Focusable="False"
Visibility="Collapsed"
views:TableView.CanScrollHorizontally="False" /> <Decorator x:Name="indentationDecorator"
Grid.Column=""> <!-- The PART_CellsHost part designates the Panel to which this Row's Cells should be added.-->
<views:FixedCellPanel x:Name="PART_CellsHost"
ColumnStretchMinWidth="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).ColumnStretchMinWidth}"
ColumnStretchMode="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).ColumnStretchMode}"
FixedCellCount="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).FixedColumnCount, Mode=TwoWay}"
FixedColumnDropMarkPen="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).FixedColumnDropMarkPen}"
Margin="{TemplateBinding BorderThickness}" />
</Decorator> </Grid> <ControlTemplate.Triggers>
<!-- When there are details, display the Toggle button for the expansion, collapsing of the details -->
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).HasDetails}"
Value="True" /> <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).AllowDetailToggle}"
Value="True" /> </MultiDataTrigger.Conditions> <Setter TargetName="detailsToggle"
Property="Visibility"
Value="Hidden" /> </MultiDataTrigger> </ControlTemplate.Triggers> </ControlTemplate> <!--**************************
* TEMPLATE: Cell
************************** -->
<ControlTemplate x:Key="tableflowViewCellTemplate"
TargetType="local:Cell"> <!-- A basic Cell Template requires at least a ContentPresenter that is used to display the Cell's Content.
This ContentPresenter is usually placed inside a Border who is responsible for painting the gridlines. --> <Grid>
<Border x:Name="gridLinesBorder" /> <Border x:Name="rootBorder"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}"> <local:CellContentPresenter x:Name="PART_CellContentPresenter"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> </Border>
</Grid> <ControlTemplate.Triggers> <!-- When changing the appearance (e.g. background/foreground) of the Cell to reflect specific
states (e.g. IsCurrent), it is recommended to apply the changes directly to the template
elements because we want those modifications to be effective even when a value has been
explicitely set to these properties on the TemplatedParent. Also, when someone queries
the value of these properties on the TemplatedParent, we don't want to return the
intermediate, state-specific values. --> <!-- When the Cell is Current, we want to change its background/foreground to the appropriate brushes.
We do this only when the cell does not have a validation error because we must give priority
to the CellErrorStyle (if present).--> <MultiTrigger>
<MultiTrigger.Conditions> <Condition Property="IsCurrent"
Value="True" /> <Condition Property="HasValidationError"
Value="False" /> </MultiTrigger.Conditions> <Setter TargetName="rootBorder"
Property="Background"
Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CurrentBackground}" /> <Setter TargetName="rootBorder"
Property="TextElement.Foreground"
Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CurrentForeground}" /> </MultiTrigger> <MultiTrigger>
<MultiTrigger.Conditions> <Condition Property="IsCurrent"
Value="True" /> <Condition Property="HasValidationError"
Value="True" /> <Condition Property="CellErrorStyle"
Value="{x:Null}" /> </MultiTrigger.Conditions> <Setter TargetName="rootBorder"
Property="Background"
Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CurrentBackground}" /> <Setter TargetName="rootBorder"
Property="TextElement.Foreground"
Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CurrentForeground}" /> </MultiTrigger> <!-- When the Cell is Selected, we want to change its background/foreground to the appropriate brushes. -->
<MultiDataTrigger>
<MultiDataTrigger.Conditions> <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=IsSelected}"
Value="True" /> <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).(local:DataGridContext.DataGridControl).IsKeyboardFocusWithin}"
Value="True" /> </MultiDataTrigger.Conditions> <Setter TargetName="rootBorder"
Property="Background"
Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=SelectionBackground}" /> <Setter TargetName="rootBorder"
Property="TextElement.Foreground"
Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=SelectionForeground}" /> </MultiDataTrigger> <!-- When the Cell is Selected but the parent DataGridControl is not focused, we want to change
the Cell's background/foreground to the appropriate brushes. -->
<MultiDataTrigger>
<MultiDataTrigger.Conditions> <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=IsSelected}"
Value="True" /> <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).(local:DataGridContext.DataGridControl).IsKeyboardFocusWithin}"
Value="False" /> <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).(local:DataGridContext.DataGridControl).HideSelection}"
Value="False" /> </MultiDataTrigger.Conditions> <Setter TargetName="rootBorder"
Property="Background"
Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=InactiveSelectionBackground}" /> <Setter TargetName="rootBorder"
Property="TextElement.Foreground"
Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=InactiveSelectionForeground}" /> </MultiDataTrigger> <!-- When the Cell's content is Null and the row is not being edited, we want to ensure that the row/cell
will preserve a minimum height based on the current font size for the row/cell. To do this, we override
the ContentPresenter's content binding and replace it with an empty string (""), the textbox generated
this way will then size to the default text's height. When trigger is not active anymore, default binding
is restored automatically. --> <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=ParentColumn.Visible}"
Value="False">
<Setter Property="Visibility"
Value="Collapsed" />
</DataTrigger> <MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).AreColumnsBeingReordered}"
Value="True" />
</MultiDataTrigger.Conditions> <Setter TargetName="gridLinesBorder"
Property="BorderBrush"
Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).VerticalGridLineBrush}" /> <Setter TargetName="gridLinesBorder"
Property="BorderThickness"
Value="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).VerticalGridLineThickness,Converter={StaticResource thicknessConverter},ConverterParameter='Left'}" /> <Setter TargetName="gridLinesBorder"
Property="Margin"
Value="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).VerticalGridLineThickness,Converter={StaticResource inverseThicknessConverter},ConverterParameter='Left'}" /> </MultiDataTrigger> </ControlTemplate.Triggers> </ControlTemplate> <!--**************************
* TEMPLATE: ColumnManagerCell
************************** -->
<ControlTemplate x:Key="tableflowViewColumnManagerCellTemplate"
TargetType="local:ColumnManagerCell"> <!-- We don't use the base Cell Template for the ColumnManagerCell because it need more elements
to function properly: a Thumb named "PART_ColumnResizerThumb" that is used to resize the
ColumnManagerCells's ParentColumn.Width and a glyph that represents the Column's SortDirection. -->
<Grid> <Border x:Name="gridLinesBorder" /> <Border BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"> <!-- This Grid is used to position the resizer Thumb over the ColumnManagerCell -->
<Grid> <Rectangle Fill="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}"
HorizontalAlignment="Left"
VerticalAlignment="Stretch"
Width=""
Margin="0,2,0,2" /> <Rectangle Fill="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"
HorizontalAlignment="Right"
VerticalAlignment="Stretch"
Width=""
Margin="0,2,0,2" /> <DockPanel>
<Border x:Name="thumbToggleBackgroundBorder"
DockPanel.Dock="Right"> <Grid> <Border x:Name="toggleDelimeterBorder"
BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"
BorderThickness="1,0,0,0"
Margin="0,4,0,4"
Background="Transparent"
Visibility="Collapsed"> <Border x:Name="toggleDelimeterBorder2"
BorderBrush="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}"
BorderThickness="1,0,0,0"
Margin="0,0,0,0"
Background="Transparent"
Visibility="Collapsed"> </Border> </Border> <ToggleButton x:Name="toggleButton"
Focusable="False"
VerticalAlignment="Stretch"
Visibility="Collapsed"
Margin="2,0,0,0"
Opacity="0.5" /> </Grid> </Border> <Border Background="{TemplateBinding Background}"> <!-- This Grid is used to layout the delimiter lines on top of the ContentPresenter -->
<Grid> <Border Padding="{TemplateBinding Padding}"> <!-- This StackPanel is used to layout the ContentPresenter and the Sort Glyph (when present). -->
<StackPanel x:Name="contentPanel"
Orientation="Horizontal"> <!-- Same ContentPresenter as in the base Cell Template. -->
<local:CellContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> <!-- ContentPresenter that is used to display the sort glyph.
We explicitly set its Content property to Null to prevent the XAML parser
from implicitly setting it to its TemplatedParent's Content. -->
<ContentPresenter x:Name="sortGlyphPresenter"
Content="{x:Null}"
ContentTemplate="{x:Null}" /> </StackPanel>
</Border> </Grid> </Border> </DockPanel> <!-- Thumb that is used to resize the Column. -->
<Thumb x:Name="PART_ColumnResizerThumbLeft"
Style="{StaticResource invisibleThumbStyle}"
Width=""
HorizontalAlignment="Left" /> <!-- Thumb that is used to resize the Column. -->
<Thumb x:Name="PART_ColumnResizerThumb"
Style="{StaticResource invisibleThumbStyle}"
Width=""
HorizontalAlignment="Right" /> </Grid> </Border>
</Grid> <ControlTemplate.Triggers> <!-- Trigger related to the filteringToggleButton-->
<Trigger SourceName="toggleButton"
Property="IsMouseOver"
Value="True"> <Setter TargetName="toggleButton"
Property="Opacity"
Value="" />
</Trigger> <Trigger Property="IsPressed"
Value="True"> <Setter TargetName="contentPanel"
Property="Margin"
Value="1,1,-1,-1" /> </Trigger> <!-- The following triggers allow the appropriate Sort Glyph to be displayed
depending on the ParentColumn's SortDirection. --> <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=ParentColumn.SortDirection}"
Value="Ascending"> <Setter TargetName="sortGlyphPresenter"
Property="ContentPresenter.ContentTemplate"
Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).AscendingSortGlyph}" /> <Setter TargetName="sortGlyphPresenter"
Property="Margin"
Value="6,0,0,0" /> </DataTrigger> <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=ParentColumn.SortDirection}"
Value="Descending"> <Setter TargetName="sortGlyphPresenter"
Property="ContentPresenter.ContentTemplate"
Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).DescendingSortGlyph}" /> <Setter TargetName="sortGlyphPresenter"
Property="Margin"
Value="6,0,0,0" /> </DataTrigger> <MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=ParentColumn.HasFixedWidth}"
Value="True" /> <!-- Don't disable resizing if ColumnStretching can be disabled by an
end-user resize. -->
<Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).RemoveColumnStretchingOnResize}"
Value="False" />
</MultiDataTrigger.Conditions> <Setter TargetName="PART_ColumnResizerThumb"
Property="IsEnabled"
Value="False" />
</MultiDataTrigger> <MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=ParentColumn.PreviousVisibleColumn.HasFixedWidth}"
Value="True" /> <!-- Don't disable resizing if ColumnStretching can be disabled by an
end-user resize. -->
<Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).RemoveColumnStretchingOnResize}"
Value="False" />
</MultiDataTrigger.Conditions> <Setter TargetName="PART_ColumnResizerThumbLeft"
Property="IsEnabled"
Value="False" />
</MultiDataTrigger> <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=ParentRow.AllowColumnResize}"
Value="False">
<Setter TargetName="PART_ColumnResizerThumb"
Property="IsEnabled"
Value="False" />
<Setter TargetName="PART_ColumnResizerThumbLeft"
Property="IsEnabled"
Value="False" />
</DataTrigger> <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=ParentColumn.Visible}"
Value="False">
<Setter Property="Visibility"
Value="Collapsed" />
</DataTrigger> <!-- To display the left vertical grid line when doing animated Column reordering -->
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).AreColumnsBeingReordered}"
Value="True" />
</MultiDataTrigger.Conditions> <Setter TargetName="gridLinesBorder"
Property="BorderBrush"
Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).VerticalGridLineBrush}" /> <Setter TargetName="gridLinesBorder"
Property="BorderThickness"
Value="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).VerticalGridLineThickness,Converter={StaticResource thicknessConverter},ConverterParameter='Left'}" /> <Setter TargetName="gridLinesBorder"
Property="Margin"
Value="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).VerticalGridLineThickness,Converter={StaticResource inverseThicknessConverter},ConverterParameter='Left'}" /> </MultiDataTrigger>
</ControlTemplate.Triggers> </ControlTemplate> <!--**************************
* TEMPLATE: GroupByControl
************************** -->
<ControlTemplate x:Key="tableflowViewGroupByControlTemplate"
TargetType="local:GroupByControl"> <Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}"> <!-- This Grid is used to position the ItemsPresenter over the ContentPresenter in charge
of displaying the NoGroupContent. -->
<Grid> <!-- This ContentPresenter displays the value of the NoGroupContent property
of the GroupByControl. This content must only be displayed when there are
no groups present, so we set its Visibility to Collapsed by default and
it is made visible via a trigger. -->
<ContentPresenter x:Name="noGroupContentPresenter"
Content="{TemplateBinding NoGroupContent}"
VerticalAlignment="Center"
Visibility="Collapsed" /> <!-- The GroupByControl is an ItemsControl, so it must have an ItemsPresenter in its
Template in order to layout and show its child items. The default ItemsPanel
of the GroupByControl is a "StaircasePanel", which layout its items in a
staircase-like pattern and draws connecting lines between the items. -->
<ItemsPresenter /> </Grid>
</Border> <ControlTemplate.Triggers> <!-- When there are no groups, make the NoGroupContent visible. -->
<Trigger Property="HasItems"
Value="False"> <Setter TargetName="noGroupContentPresenter"
Property="Visibility"
Value="Visible" />
</Trigger> </ControlTemplate.Triggers> </ControlTemplate> <!--**************************
* TEMPLATE: GroupByItem
************************** -->
<ControlTemplate x:Key="tableflowViewGroupByItemTemplate"
TargetType="local:GroupByItem"> <Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}"> <!-- This StackPanel is used to layout the ContentPresenter and the Sort Glyph (when present). -->
<StackPanel Orientation="Horizontal"> <!-- Same ContentPresenter as in the base Cell Template. -->
<ContentPresenter Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> <!-- ContentPresenter that is used to display the sort glyph.
We explicitely set its Content property to Null to prevent the XAML parser
from implicitely setting it to its TemplatedParent's Content. -->
<ContentPresenter x:Name="sortGlyphPresenter"
Content="{x:Null}"
ContentTemplate="{x:Null}" /> </StackPanel>
</Border> <ControlTemplate.Triggers> <!-- The following triggers allow to display the appropriate Sort Glyph
depending on the ParentColumn's SortDirection. -->
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=SortDirection}"
Value="Ascending"> <Setter TargetName="sortGlyphPresenter"
Property="ContentPresenter.ContentTemplate"
Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).AscendingSortGlyph}" /> <Setter TargetName="sortGlyphPresenter"
Property="Margin"
Value="6,0,0,0" /> </DataTrigger> <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=SortDirection}"
Value="Descending"> <Setter TargetName="sortGlyphPresenter"
Property="ContentPresenter.ContentTemplate"
Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).DescendingSortGlyph}" /> <Setter TargetName="sortGlyphPresenter"
Property="Margin"
Value="6,0,0,0" /> </DataTrigger>
</ControlTemplate.Triggers> </ControlTemplate> <!--**************************
* TEMPLATE: GroupHeaderControl
************************** -->
<conv:IntAdditionConverter x:Key="groupHeaderControlGroupLevelConverter" />
<ControlTemplate x:Key="tableflowViewGroupHeaderControlTemplate"
TargetType="local:GroupHeaderControl"> <!-- Using this decorator will prevent the GroupHeaderControl of exceeding the width
defined by the grid's column. -->
<views:PassiveLayoutDecorator Axis="Horizontal">
<!-- This DockPanel is used to layout the GroupLevelIndicatorPane placeholder and the GroupHeaderControl Content. -->
<DockPanel> <!-- GroupLevelIndicatorPane is a placeholder for individual GroupLevelIndicator elements that are added
whenever this GroupHeaderControl is part of a group. -->
<local:HierarchicalGroupLevelIndicatorPane DockPanel.Dock="Left" />
<local:GroupLevelIndicatorPane DockPanel.Dock="Left"
Indented="False"
local:GroupLevelIndicatorPane.GroupLevel="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:GroupLevelIndicatorPane.GroupLevel), Converter={StaticResource groupHeaderControlGroupLevelConverter}, ConverterParameter=-1}" /> <!-- Main Border for the GroupHeaderControl. It is Focusable to make the InputBindings work. -->
<Border x:Name="mainBorder"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}"
Focusable="True"
FocusVisualStyle="{TemplateBinding FocusVisualStyle}"> <!-- Define all the standard InputBindings for a GroupHeaderControl. -->
<Border.InputBindings>
<KeyBinding Command="{x:Static local:DataGridCommands.ToggleGroupExpansion}"
Key="Space" /> <KeyBinding Command="{x:Static local:DataGridCommands.ExpandGroup}"
Key="Right" /> <KeyBinding Command="{x:Static local:DataGridCommands.ExpandGroup}"
Key="Add" /> <KeyBinding Command="{x:Static local:DataGridCommands.CollapseGroup}"
Key="Left" /> <KeyBinding Command="{x:Static local:DataGridCommands.CollapseGroup}"
Key="Subtract" /> <MouseBinding Command="{x:Static local:DataGridCommands.ToggleGroupExpansion}"
MouseAction="LeftDoubleClick" /> </Border.InputBindings> <!-- This StackPanel is used to layout the ToggleButton and the GroupHeaderControl. -->
<StackPanel Orientation="Horizontal"> <!-- ToggleButton that is used to expand/collapse the group. -->
<ToggleButton Template="{StaticResource groupExpanderToggleButtonTemplate}"
OverridesDefaultStyle="True"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Focusable="False"
IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent},Path=Group.IsExpanded}" /> <!-- ContentPresenter in charge of displaying this GroupHeaderControl's Content, which is
a Group by default. -->
<ContentPresenter Margin="3,0,0,0"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> </StackPanel>
</Border>
</DockPanel>
</views:PassiveLayoutDecorator> <ControlTemplate.Triggers>
<Trigger Property="local:DataGridControl.NavigationBehavior"
Value="None">
<Setter TargetName="mainBorder"
Property="Focusable"
Value="False" />
</Trigger>
</ControlTemplate.Triggers> </ControlTemplate> <!--**************************
* TEMPLATE: GroupLevelIndicator
************************** -->
<ControlTemplate x:Key="tableflowViewGroupLevelIndicatorTemplate"
TargetType="local:GroupLevelIndicator"> <Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}" /> </ControlTemplate> <!--**************************
* TEMPLATE: DetailIndicator
************************** -->
<ControlTemplate x:Key="tableflowViewDetailIndicatorTemplate"
TargetType="local:DetailIndicator"> <Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}" /> </ControlTemplate> <!--**************************
* TEMPLATE: GroupLevelIndicatorPane
************************** -->
<ControlTemplate x:Key="tableflowViewGroupLevelIndicatorPaneTemplate"
TargetType="local:GroupLevelIndicatorPane">
<Grid> <Border x:Name="horizontalBorder"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).HorizontalGridLineThickness, Converter={StaticResource thicknessConverter}, ConverterParameter='Top'}" /> <Border x:Name="verticalBorder"
BorderBrush="{TemplateBinding BorderBrush}"
Padding="{TemplateBinding Padding}"
BorderThickness="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).VerticalGridLineThickness, Converter={StaticResource thicknessConverter}, ConverterParameter='Left'}">
<StackPanel x:Name="PART_GroupLevelIndicatorHost"
Orientation="Horizontal" />
</Border> </Grid>
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsLeaf"
Value="True" />
<Condition Property="views:ViewBase.IsLastItem"
Value="True" />
<Condition Property="local:DataGridControl.HasExpandedDetails"
Value="False" />
</MultiTrigger.Conditions>
<Setter TargetName="horizontalBorder"
Property="BorderThickness"
Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).HorizontalGridLineThickness, Converter={StaticResource thicknessConverter}, ConverterParameter='Top, Bottom'}" />
<Setter TargetName="verticalBorder"
Property="Margin"
Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).HorizontalGridLineThickness, Converter={StaticResource thicknessConverter}, ConverterParameter='Bottom'}" />
</MultiTrigger> <MultiTrigger>
<MultiTrigger.Conditions> <Condition Property="CurrentIndicatorCount"
Value="" /> <Condition Property="IsLeaf"
Value="False" /> </MultiTrigger.Conditions> <Setter TargetName="verticalBorder"
Property="BorderThickness"
Value="" /> </MultiTrigger> <Trigger Property="ShowVerticalBorder"
Value="False">
<Setter TargetName="verticalBorder"
Property="BorderThickness"
Value="" />
</Trigger> </ControlTemplate.Triggers>
</ControlTemplate> <!--**************************
* TEMPLATE: HierarchicalGroupLevelIndicatorPane
************************** -->
<ControlTemplate x:Key="tableflowViewHierarchicalGroupLevelIndicatorPaneTemplate"
TargetType="local:HierarchicalGroupLevelIndicatorPane">
<Border BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<StackPanel x:Name="PART_GroupLevelIndicatorHost"
Orientation="Horizontal" />
</Border> </ControlTemplate> <!--**************************
* TEMPLATE: HierarchicalGroupByControl
************************** --> <!-- DataTemplate for DataGridContext displayed inside the HierarchicalGroupByControl -->
<HierarchicalDataTemplate x:Key="dataGridContextTemplate"
DataType="{x:Type local:DataGridContext}"
ItemsSource="{Binding Path=DetailConfigurations}"> <local:HierarchicalGroupByControlNode x:Name="groupByControlNode"
ItemsSource="{Binding Path=GroupLevelDescriptions}"
Title="{Binding Path=SourceDetailConfiguration.Title}" /> <!-- Trigger to bind Title to the DataGridContext.DataGridControl.ItemsSourceName if DataGridContext.ParentDataGridContext is null -->
<HierarchicalDataTemplate.Triggers>
<DataTrigger Binding="{Binding Path=SourceDetailConfiguration}"
Value="{x:Null}">
<Setter TargetName="groupByControlNode"
Property="Title">
<Setter.Value>
<Binding Path="DataGridControl.ItemsSourceName" />
</Setter.Value>
</Setter>
</DataTrigger>
</HierarchicalDataTemplate.Triggers> </HierarchicalDataTemplate> <!-- DataTemplate for DetailConfiguration displayed inside the HierarchicalGroupByControlNode -->
<HierarchicalDataTemplate x:Key="detailConfigurationTemplate"
DataType="{x:Type local:DetailConfiguration}"
ItemsSource="{Binding Path=DetailConfigurations}"> <local:HierarchicalGroupByControlNode ItemsSource="{Binding Path=GroupLevelDescriptions}"
Title="{Binding Title}" />
</HierarchicalDataTemplate> <conv:TypeToVisibilityConverter x:Key="notDetailConfigConverter"
Visibility="Visible"
SetVisibilityWhenTrue="False" /> <BooleanToVisibilityConverter x:Key="booleanToVisibilityConverter" /> <!-- TreeViewItem Style to avoid displaying Expander and avoid selection and click -->
<Style x:Key="hierarchicalGroupByControlTreeViewItemStyle"
TargetType="{x:Type TreeViewItem}"> <Setter Property="IsExpanded"
Value="True" /> <Setter Property="Focusable"
Value="False" /> <Setter Property="Visibility">
<Setter.Value>
<PriorityBinding>
<Binding Path="."
Converter="{StaticResource notDetailConfigConverter}"
ConverterParameter="{x:Type local:DetailConfiguration}" />
<Binding Path="Visible"
Converter="{StaticResource booleanToVisibilityConverter}" />
</PriorityBinding> </Setter.Value>
</Setter> <Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TreeViewItem}">
<Grid>
<Grid.ColumnDefinitions> <!--This ColumnDefinition is required for stair spacing-->
<ColumnDefinition Width="" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions> <Border BorderThickness="{TemplateBinding Border.BorderThickness}"
Padding="{TemplateBinding Control.Padding}"
BorderBrush="{TemplateBinding Border.BorderBrush}"
Background="{TemplateBinding Panel.Background}"
Name="treeViewItemBorder"
SnapsToDevicePixels="True"
Grid.Column=""> <!--Will contain DetailGroupByConrol--> <ContentPresenter Content="{TemplateBinding HeaderedContentControl.Header}"
ContentTemplate="{TemplateBinding HeaderedContentControl.HeaderTemplate}"
ContentSource="Header"
Name="PART_Header"
HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
</Border> <ItemsPresenter Name="ItemsHost"
Grid.Column=""
Grid.Row=""
Grid.ColumnSpan="" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style> <ControlTemplate x:Key="tableflowViewCommonHierarchicalGroupByControlTemplate"
TargetType="local:HierarchicalGroupByControl">
<ControlTemplate.Resources>
<!--this style is set to avoid having implicit treeview style
overide the HierarchicalGroupByControl's TreeView-->
<Style TargetType="TreeView" />
</ControlTemplate.Resources> <!-- This Grid is used to layout the GroupLevelIndicatorPane placeholder and the HierarchicalGroupByControl -->
<Grid x:Name="rootGrid">
<Grid.ColumnDefinitions>
<!-- HierarchicalGroupLevelIndicatorPane -->
<ColumnDefinition Width="Auto" />
<!-- GroupLevelIndicatorPane -->
<ColumnDefinition Width="Auto" /> <!-- HierarchicalGroupByControl -->
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> <!-- The border responsible for the visual outline of the row (gridlines and background)
spans the GroupLevelIndicatorPane and CellsHost Panel. Those elements are not children of
the Border because we don't want the border to be displayed in the GroupLevelIndicatorPane. -->
<Border x:Name="rootBorder"
Grid.Column=""
Grid.ColumnSpan=""
Background="{TemplateBinding Background}"
BorderBrush="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).HorizontalGridLineBrush}"
BorderThickness="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).HorizontalGridLineThickness,Converter={StaticResource thicknessConverter},ConverterParameter='Top'}"
Padding="{TemplateBinding Padding}" /> <Border x:Name="verticalGridLineBorder"
Grid.Column=""
Grid.ColumnSpan=""
BorderBrush="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).VerticalGridLineBrush}"
BorderThickness="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).VerticalGridLineThickness,Converter={StaticResource thicknessConverter},ConverterParameter='Right'}" /> <local:HierarchicalGroupLevelIndicatorPane Grid.Column="" /> <!-- GroupLevelIndicatorPane is a placeholder for individual GroupLevelIndicator elements that are added
whenever this Row is part of a group. -->
<local:GroupLevelIndicatorPane x:Name="groupLevelIndicatorPane"
Grid.Column="" /> <StackPanel Grid.Column=""
Orientation="Horizontal"> <TreeView x:Name="PART_HierarchicalGroupByControlTreeView"
ItemContainerStyle="{StaticResource hierarchicalGroupByControlTreeViewItemStyle}"
Background="Transparent"
BorderBrush="Transparent"
Focusable="False"> <TreeViewItem Header="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext)}"
HeaderTemplate="{StaticResource dataGridContextTemplate}"
ItemsSource="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).DetailConfigurations}"
ItemTemplate="{StaticResource detailConfigurationTemplate}"
ItemContainerStyle="{StaticResource hierarchicalGroupByControlTreeViewItemStyle}"
IsExpanded="True" />
</TreeView> <ContentPresenter x:Name="noGroupContentPresenter"
Content="{TemplateBinding NoGroupContent}"
VerticalAlignment="Center"
Visibility="Collapsed"
Margin="5,0,0,0" /> </StackPanel> </Grid>
<ControlTemplate.Triggers> <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=HasGroups}"
Value="True"> <Setter TargetName="noGroupContentPresenter"
Property="Visibility"
Value="Visible" /> </DataTrigger> <DataTrigger Binding="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:GroupLevelIndicatorPane.GroupLevel)}"
Value="-1">
<Setter TargetName="groupLevelIndicatorPane"
Property="Visibility"
Value="Collapsed" />
<Setter TargetName="verticalGridLineBorder"
Property="BorderThickness"
Value="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).VerticalGridLineThickness,Converter={StaticResource thicknessConverter},ConverterParameter='Right, Left'}" />
</DataTrigger> </ControlTemplate.Triggers> </ControlTemplate> <ControlTemplate x:Key="tableflowViewCommonHierarchicalGroupByControlOldGroupByControlTemplate"
TargetType="local:HierarchicalGroupByControl"> <!-- This Grid is used to layout the GroupLevelIndicatorPane placeholder and the HierarchicalGroupByControl -->
<Grid x:Name="rootGrid">
<Grid.ColumnDefinitions>
<!-- HierarchicalGroupLevelIndicatorPane -->
<ColumnDefinition Width="Auto" />
<!-- GroupLevelIndicatorPane -->
<ColumnDefinition Width="Auto" /> <!-- HierarchicalGroupByControl -->
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> <!-- The border responsible for the visual outline of the row (gridlines and background)
spans the GroupLevelIndicatorPane and CellsHost Panel. Those elements are not children of
the Border because we don't want the border to be displayed in the GroupLevelIndicatorPane. -->
<Border x:Name="rootBorder"
Grid.Column=""
Grid.ColumnSpan=""
Background="{TemplateBinding Background}"
BorderBrush="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).HorizontalGridLineBrush}"
BorderThickness="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).HorizontalGridLineThickness,Converter={StaticResource thicknessConverter},ConverterParameter='Top'}"
Padding="{TemplateBinding Padding}" /> <Border x:Name="verticalGridLineBorder"
Grid.Column=""
Grid.ColumnSpan=""
BorderBrush="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).VerticalGridLineBrush}"
BorderThickness="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).VerticalGridLineThickness,Converter={StaticResource thicknessConverter},ConverterParameter='Right'}" /> <local:HierarchicalGroupLevelIndicatorPane Grid.Column="" /> <!-- GroupLevelIndicatorPane is a placeholder for individual GroupLevelIndicator elements that are added
whenever this Row is part of a group. -->
<local:GroupLevelIndicatorPane x:Name="groupLevelIndicatorPane"
Grid.Column="" /> <local:GroupByControl Grid.Column=""
BorderBrush="{TemplateBinding BorderBrush}"
Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}"
AllowGroupingModification="{TemplateBinding AllowGroupingModification}"
AllowSort="{TemplateBinding AllowSort}"
ConnectionLinePen="{TemplateBinding ConnectionLinePen}"
NoGroupContent="{TemplateBinding NoGroupContent}"
views:TableView.CanScrollHorizontally="True" /> </Grid> <ControlTemplate.Triggers> <DataTrigger Binding="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:GroupLevelIndicatorPane.GroupLevel)}"
Value="-1">
<Setter TargetName="groupLevelIndicatorPane"
Property="Visibility"
Value="Collapsed" />
<Setter TargetName="verticalGridLineBorder"
Property="BorderThickness"
Value="{Binding RelativeSource={RelativeSource Self},Path=(local:DataGridControl.DataGridContext).VerticalGridLineThickness,Converter={StaticResource thicknessConverter},ConverterParameter='Right, Left'}" />
</DataTrigger> </ControlTemplate.Triggers> </ControlTemplate> <!--**************************
* TEMPLATE: HierarchicalGroupByControlNode
************************** -->
<ControlTemplate x:Key="tableflowViewHierarchicalGroupByControlNodeTemplate"
TargetType="local:HierarchicalGroupByControlNode"> <StackPanel Orientation="Horizontal"
Background="{TemplateBinding Background}"> <TextBlock x:Name="titleTextBlock"
Text="{TemplateBinding Title}"
Margin="0,0,10,0" /> <ItemsPresenter Margin="0,0,0,10" />
</StackPanel> </ControlTemplate> <!--**************************
* TEMPLATE: HierarchicalGroupByItem
************************** -->
<ControlTemplate x:Key="tableflowViewHierarchicalGroupByItemTemplate"
TargetType="local:HierarchicalGroupByItem"> <Border x:Name="outerBorder"
BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}"
Background="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}"
BorderThickness="0,0,1,1"
Padding="1,1,0,0"> <Border x:Name="innerBorder"
BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"
BorderThickness="0,0,1,1"
Margin="1,1,0,0"
Background="{TemplateBinding Background}"
Padding="{TemplateBinding Padding}"> <!-- This StackPanel is used to layout the ContentPresenter and the Sort Glyph (when present). -->
<StackPanel x:Name="contentPanel"
Orientation="Horizontal"> <!-- Same ContentPresenter as in the base Cell Template. -->
<ContentPresenter Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> <!-- ContentPresenter that is used to display the sort glyph.
We explicitly set its Content property to Null to prevent the XAML parser
from implicitly setting it to its TemplatedParent's Content. -->
<ContentPresenter x:Name="sortGlyphPresenter"
Content="{x:Null}"
ContentTemplate="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).AscendingSortGlyph}"
Margin="6,0,0,0"
Visibility="Hidden" /> </StackPanel> </Border> </Border> <ControlTemplate.Triggers> <Trigger Property="IsPressed"
Value="True"> <Setter TargetName="outerBorder"
Property="BorderBrush"
Value="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" /> <Setter TargetName="outerBorder"
Property="BorderThickness"
Value="" /> <Setter TargetName="outerBorder"
Property="Padding"
Value="" /> <Setter TargetName="innerBorder"
Property="BorderThickness"
Value="" /> <Setter TargetName="innerBorder"
Property="Margin"
Value="" /> <Setter TargetName="contentPanel"
Property="Margin"
Value="1,1,-1,-1" /> </Trigger> <!-- The following triggers allow the appropriate Sort Glyph to be displayed
depending on the ParentColumn's SortDirection. -->
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=SortDirection}"
Value="Ascending"> <Setter TargetName="sortGlyphPresenter"
Property="ContentPresenter.ContentTemplate"
Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).AscendingSortGlyph}" /> <Setter TargetName="sortGlyphPresenter"
Property="Visibility"
Value="Visible" /> </DataTrigger> <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=SortDirection}"
Value="Descending"> <Setter TargetName="sortGlyphPresenter"
Property="ContentPresenter.ContentTemplate"
Value="{Binding RelativeSource={RelativeSource Self}, Path=(local:DataGridControl.DataGridContext).DescendingSortGlyph}" /> <Setter TargetName="sortGlyphPresenter"
Property="Visibility"
Value="Visible" /> </DataTrigger>
</ControlTemplate.Triggers> </ControlTemplate> <!--**************************
* TEMPLATE: ScrollTip
************************** -->
<ControlTemplate x:Key="tableflowViewScrollTipTemplate"
TargetType="{x:Type local:ScrollTip}">
<ContentPresenter VerticalAlignment="Center"
HorizontalAlignment="Right"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" />
</ControlTemplate> </ResourceDictionary>
xceed wpf datagrid的更多相关文章
- WPF DataGrid常用属性记录
WPF DataGrid常用属性记录 组件常用方法: BeginEdit:使DataGrid进入编辑状态. CancelEdit:取消DataGrid的编辑状态. CollapseRowGroup:闭 ...
- WPF DATAGRID - COMMITTING CHANGES CELL-BY-CELL
In my recent codeproject article on the DataGrid I described a number of techniques for handling the ...
- WPF DataGrid某列使用多绑定后该列排序失效,列上加入 SortMemberPath 设置即可.
WPF DataGrid某列使用多绑定后该列排序失效 2011-07-14 10:59hdongq | 浏览 1031 次 悬赏:20 在wpf的datagrid中某一列使用了多绑定,但是该列排序失 ...
- 获取wpf datagrid当前被编辑单元格的内容
原文 获取wpf datagrid当前被编辑单元格的内容 确认修改单元个的值, 使用到datagrid的两个事件 开始编辑事件 BeginningEdit="dataGrid_Beginni ...
- WPF DataGrid绑定一个组合列
WPF DataGrid绑定一个组合列 前台: <Page.Resources> <local:InfoConverter x:Key="converter& ...
- WPF DataGrid自定义样式
微软的WPF DataGrid中有很多的属性和样式,你可以调整,以寻找合适的(如果你是一名设计师).下面,找到我的小抄造型的网格.它不是100%全面,但它可以让你走得很远,有一些非常有用的技巧和陷阱. ...
- WPF DataGrid显格式
Guide to WPF DataGrid formatting using bindings Peter Huber SG, 25 Nov 2013 CPOL 4.83 (13 votes) ...
- WPF DataGrid Custommization using Style and Template
WPF DataGrid Custommization using Style and Template 代码下载:http://download.csdn.net/detail/wujicai/81 ...
- 编写 WPF DataGrid 列模板,实现更好的用户体验
Julie Lerman 下载代码示例 最近我在为一个客户做一些 Windows Presentation Foundation (WPF) 方面的工作. 虽然我提倡使用第三方工具,但有时也会避免使用 ...
随机推荐
- C++ Virtual详解(注意函数被隐藏的问题)
Virtual是C++ OO机制中很重要的一个关键字.只要是学过C++的人都知道在类Base中加了Virtual关键字的函数就是虚拟函数(例如函数print),于是在Base的派生类Derived中就 ...
- TEdit,TMemo背景透明
The component below works perfectly, except for the following problem: 1) Saves the component below ...
- Spring MVC 解读——@RequestMapping (1)(转)
转自:http://my.oschina.net/HeliosFly/blog/212329 Spring MVC 解读——@RequestMapping 为了降低文章篇幅,使得文章更目标化,简洁化, ...
- Git标签管理
一般我们发布一个新版本到线上服务器时都会在版本库中打一个标签,这时就确定了某个版本将发布到线上.我们可以随时可以查看这个打标签的版本,也就 是说标签其实呢,就是版本库中一个快照.简单说标签就是指向某个 ...
- 14.5.4 Phantom Rows 幻影行
14.5.4 Phantom Rows 幻影行 所谓的幻读问题发生在一个事务 当相同的查询产生不同的结果集在不同的时间. 例如,如果一个SELECT 是执行2次,但是第2次返回的时间不第一次返回不同, ...
- Unity 利用Coroutine实现跳动数字效果
纯粹转载:转载注明参考链接! 参考链接:http://xataxnova.blog.163.com/blog/static/236620063201451061738122/,作者:网易博客 xata ...
- [LeetCode#271] Encode and Decode Strings
Problem: Design an algorithm to encode a list of strings to a string. The encoded string is then sen ...
- 【转】Android 驱动开发系列四
原文网址:http://www.2cto.com/kf/201304/202040.html 时隔多日,终于都抽出时间来写blog了.废话不多说,接着上一篇,这里将介绍如何编写HAL层(硬件抽象层)对 ...
- Eclipse下安装及配置maven项目管理工具
①eclipse下maven插件安装. 本地maven安装.环境变量配置完成后,打开eclipse,点击eclipse菜单栏Help->Eclipse Marketplace搜索关键字maven ...
- openStack云平台虚拟桌面galera mysql 3节点集群实例实战