Hi,
I have two different AggregateFunctions in a GridViewDataColumn, and I would like to show the results in different objects. The first one should be shown in a TextBox, and the second, in a TextBlock.
This is the closer I got so far, but, obviously, both AggregateFunctions results are shown in a TextBox:
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding StadiumCapacity}"
Header
=
"Stadium capacity"
>
<
telerik:GridViewDataColumn.AggregateFunctions
>
<
local:CapacityAggregation
/>
<
local:YearsLeftAggregation
/>
</
telerik:GridViewDataColumn.AggregateFunctions
>
<
telerik:GridViewDataColumn.Footer
>
<
StackPanel
Orientation
=
"Vertical"
>
<
telerik:AggregateResultsList
ItemsSource
=
"{Binding}"
VerticalAlignment
=
"Center"
>
<
ItemsControl.ItemTemplate
>
<
DataTemplate
>
<
TextBox
VerticalAlignment
=
"Center"
Text
=
"{Binding FormattedValue}"
/>
</
DataTemplate
>
</
ItemsControl.ItemTemplate
>
</
telerik:AggregateResultsList
>
</
StackPanel
>
</
telerik:GridViewDataColumn.Footer
>
</
telerik:GridViewDataColumn
>
How can I achieve this? Any help would be appreciated.
6 Answers, 1 is accepted
You can achieve this by using a regular ItemsControl instead of our AggregateResultsList, which is an ItemsCotrol too, but you can not use its ItemTemplateSelector. Basically, by using ItemsControl's ItemTempalteSelector you can choose to return a different template for its items. Please check the attached sample project for a reference and let me know how it works for you.
Regards,
Yoan
Telerik
Hi, Yoan. Thanks for the answer, but unfortunately, it didn't help. I'm pasting my grid and attaching an image with the result.
Notice that my custom footer is in the second RadGridView element. It's important to mention that I have created my AggregateTemplateSelectorStyle class, and I think there is no problem with that, since, while debugging, the breakpoint in it is hit.
As you can see in the attached image, the result concatenates the AggregateFunctions' captions to the actual value, and no textbox is being rendered.
I appreciate if you could help.
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
Height
=
"Auto"
/>
</
Grid.RowDefinitions
>
<
Grid.Resources
>
<
Style
x:Key
=
"RadGridViewHeaderGroupStyle"
TargetType
=
"telerik:CommonColumnHeader"
>
<
Setter
Property
=
"HorizontalContentAlignment"
Value
=
"Center"
/>
<
Setter
Property
=
"Visibility"
Value
=
"Hidden"
/>
</
Style
>
<
Style
TargetType
=
"telerik:GridViewGroupRow"
>
<
Setter
Property
=
"ShowHeaderAggregates"
Value
=
"False"
></
Setter
>
<
Setter
Property
=
"IsExpanded"
Value
=
"True"
></
Setter
>
</
Style
>
<
Style
TargetType
=
"telerik:GridViewGroupFooterCell"
x:Key
=
"RadGridViewGroupFooterCellStyle"
>
<
Setter
Property
=
"VerticalContentAlignment"
Value
=
"Top"
></
Setter
>
</
Style
>
<
Style
TargetType
=
"telerik:GridViewGroupFooterCell"
x:Key
=
"RadGridViewGroupFooterCellStyleTotal"
>
<
Setter
Property
=
"VerticalContentAlignment"
Value
=
"Top"
></
Setter
>
<
Setter
Property
=
"FontWeight"
Value
=
"Bold"
/>
</
Style
>
<
my:TotalUnistExplodeStyle
x:Key
=
"totalUnitsExplodeStyle"
>
<
my:TotalUnistExplodeStyle.ValidationErrorStyle
>
<
Style
TargetType
=
"telerik:GridViewRow"
>
<
Setter
Property
=
"Background"
Value
=
"Pink"
/>
<
Setter
Property
=
"ToolTip"
Value
=
"Total Units for Exploded don't match."
/>
<
Setter
Property
=
"telerik:StyleManager.Theme"
Value
=
""
/>
</
Style
>
</
my:TotalUnistExplodeStyle.ValidationErrorStyle
>
<
my:TotalUnistExplodeStyle.ValidationOkStyle
>
<
Style
TargetType
=
"telerik:GridViewRow"
>
<
Setter
Property
=
"Background"
Value
=
"White"
/>
<
Setter
Property
=
"telerik:StyleManager.Theme"
Value
=
"Metro"
/>
</
Style
>
</
my:TotalUnistExplodeStyle.ValidationOkStyle
>
</
my:TotalUnistExplodeStyle
>
<
selector:MultiEditableToBrushSelector
x:Key
=
"MultiEditableToBrushSelector"
>
<
selector:MultiEditableToBrushSelector.WhiteStyle
>
<
Style
TargetType
=
"telerik:GridViewCell"
>
<
Setter
Property
=
"Background"
Value
=
"White"
/>
</
Style
>
</
selector:MultiEditableToBrushSelector.WhiteStyle
>
<
selector:MultiEditableToBrushSelector.LightYellowStyle
>
<
Style
TargetType
=
"telerik:GridViewCell"
>
<
Setter
Property
=
"Background"
Value
=
"#FFFFE0"
/>
</
Style
>
</
selector:MultiEditableToBrushSelector.LightYellowStyle
>
</
selector:MultiEditableToBrushSelector
>
<
selector:SingleEditableToBrushSelector
x:Key
=
"SingleEditableToBrushSelector"
>
<
selector:SingleEditableToBrushSelector.WhiteStyle
>
<
Style
TargetType
=
"telerik:GridViewCell"
>
<
Setter
Property
=
"Background"
Value
=
"White"
/>
</
Style
>
</
selector:SingleEditableToBrushSelector.WhiteStyle
>
<
selector:SingleEditableToBrushSelector.LightYellowStyle
>
<
Style
TargetType
=
"telerik:GridViewCell"
>
<
Setter
Property
=
"Background"
Value
=
"#FFFFE0"
/>
</
Style
>
</
selector:SingleEditableToBrushSelector.LightYellowStyle
>
</
selector:SingleEditableToBrushSelector
>
<
Style
TargetType
=
"telerik:GridViewHeaderRow"
>
<
Setter
Property
=
"Visibility"
Value
=
"Hidden"
></
Setter
>
</
Style
>
<
my:AggregateTemplateSelectorStyle
x:Key
=
"aggregateTemplateSelectorStyle"
>
<
my:AggregateTemplateSelectorStyle.textBoxTemplate
>
<
DataTemplate
x:Name
=
"textBoxTemplate"
>
<
TextBox
VerticalAlignment
=
"Center"
Text
=
"{Binding FormattedValue}"
/>
</
DataTemplate
>
</
my:AggregateTemplateSelectorStyle.textBoxTemplate
>
<
my:AggregateTemplateSelectorStyle.textBlockTemplate
>
<
DataTemplate
x:Name
=
"textBlockTemplate"
>
<
TextBlock
VerticalAlignment
=
"Center"
Text
=
"{Binding FormattedValue}"
/>
</
DataTemplate
>
</
my:AggregateTemplateSelectorStyle.textBlockTemplate
>
</
my:AggregateTemplateSelectorStyle
>
</
Grid.Resources
>
<
telerik:RadGridView
x:Name
=
"PackRecommendationTotal"
AutoGenerateColumns
=
"False"
IsReadOnly
=
"False"
RowIndicatorVisibility
=
"Collapsed"
GridLinesVisibility
=
"Vertical"
ShowGroupPanel
=
"False"
ItemsSource
=
"{Binding PackRecommendationTotalList, Mode=TwoWay}"
ShowGroupFooters
=
"True"
Grid.Row
=
"0"
Grid.Column
=
"0"
ShowColumnHeaders
=
"False"
CellEditEnded
=
"PackRecommendationTotal_CellEditEnded"
ValidatesOnDataErrors
=
"None"
CanUserDeleteRows
=
"False"
RowStyleSelector
=
"{StaticResource totalUnitsExplodeStyle}"
>
<
telerik:RadGridView.ColumnGroups
>
<
telerik:GridViewColumnGroup
Name
=
"Size"
Header
=
"Pack Type"
HeaderStyle
=
"{StaticResource RadGridViewHeaderGroupStyle}"
/>
<
telerik:GridViewColumnGroup
Name
=
"Multi"
Header
=
"Multi"
HeaderStyle
=
"{StaticResource RadGridViewHeaderGroupStyle}"
/>
<
telerik:GridViewColumnGroup
Name
=
"Single"
Header
=
"Single"
HeaderStyle
=
"{StaticResource RadGridViewHeaderGroupStyle}"
/>
<
telerik:GridViewColumnGroup
Name
=
"Bulk"
Header
=
"Bulk"
HeaderStyle
=
"{StaticResource RadGridViewHeaderGroupStyle}"
/>
<
telerik:GridViewColumnGroup
Name
=
"TotalUnits"
Header
=
"Total Units"
HeaderStyle
=
"{StaticResource RadGridViewHeaderGroupStyle}"
/>
<
telerik:GridViewColumnGroup
Name
=
"UnitsPostReg"
Header
=
"Units Post Reg"
HeaderStyle
=
"{StaticResource RadGridViewHeaderGroupStyle}"
/>
</
telerik:RadGridView.ColumnGroups
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding DistributionCenter}"
UniqueName
=
"DistributionCenter"
IsGroupable
=
"True"
ShowColumnWhenGrouped
=
"False"
>
<
telerik:GridViewDataColumn.GroupHeaderTemplate
>
<
DataTemplate
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
TextBlock
Text
=
"{Binding Group.Items[0].Unsolvable}"
/>
</
StackPanel
>
</
DataTemplate
>
</
telerik:GridViewDataColumn.GroupHeaderTemplate
>
</
telerik:GridViewDataColumn
>
<
telerik:GridViewDataColumn
Header
=
"Size"
ColumnGroupName
=
"Size"
DataMemberBinding
=
"{Binding SizeType}"
HeaderTextAlignment
=
"Center"
Width
=
"100"
IsGroupable
=
"False"
GroupFooterCellStyle
=
"{StaticResource RadGridViewGroupFooterCellStyleTotal}"
IsReadOnly
=
"True"
>
<
telerik:GridViewDataColumn.AggregateFunctions
>
<
views:Total
/>
<
views:TotalPercent
/>
</
telerik:GridViewDataColumn.AggregateFunctions
>
</
telerik:GridViewDataColumn
>
<
telerik:GridViewMaskedInputColumn
Header
=
"Prepack"
ColumnGroupName
=
"Multi"
DataMemberBinding
=
"{Binding MultiPrePack}"
HeaderTextAlignment
=
"Center"
Width
=
"100"
IsGroupable
=
"False"
GroupFooterCellStyle
=
"{StaticResource RadGridViewGroupFooterCellStyle}"
MaskType
=
"Numeric"
IsReadOnlyBinding
=
"{Binding MultiPrepackEditable}"
CellStyleSelector
=
"{StaticResource MultiEditableToBrushSelector}"
>
<
telerik:GridViewMaskedInputColumn.AggregateFunctions
>
<
telerik:SumFunction
/>
</
telerik:GridViewMaskedInputColumn.AggregateFunctions
>
</
telerik:GridViewMaskedInputColumn
>
<
telerik:GridViewDataColumn
Header
=
"Imploded"
ColumnGroupName
=
"Multi"
DataMemberBinding
=
"{Binding MultiImploded}"
HeaderTextAlignment
=
"Center"
Width
=
"100"
IsGroupable
=
"False"
GroupFooterCellStyle
=
"{StaticResource RadGridViewGroupFooterCellStyle}"
IsReadOnly
=
"True"
>
<
telerik:GridViewDataColumn.AggregateFunctions
>
<
telerik:SumFunction
/>
</
telerik:GridViewDataColumn.AggregateFunctions
>
</
telerik:GridViewDataColumn
>
<
telerik:GridViewDataColumn
Header
=
"Exploded"
ColumnGroupName
=
"Multi"
DataMemberBinding
=
"{Binding MultiExploded}"
HeaderTextAlignment
=
"Center"
Width
=
"100"
IsGroupable
=
"False"
GroupFooterCellStyle
=
"{StaticResource RadGridViewGroupFooterCellStyle}"
IsReadOnly
=
"True"
>
<
telerik:GridViewDataColumn.AggregateFunctions
>
<
telerik:SumFunction
/>
<
views:MultiUnitTotalUnitsPercent
Caption
=
"% "
ResultFormatString
=
"{}{0:0.00}"
/>
</
telerik:GridViewDataColumn.AggregateFunctions
>
</
telerik:GridViewDataColumn
>
<
telerik:GridViewMaskedInputColumn
Header
=
"Prepack"
ColumnGroupName
=
"Single"
DataMemberBinding
=
"{Binding SinglePrepack}"
HeaderTextAlignment
=
"Center"
Width
=
"100"
IsGroupable
=
"False"
GroupFooterCellStyle
=
"{StaticResource RadGridViewGroupFooterCellStyle}"
MaskType
=
"Numeric"
IsReadOnlyBinding
=
"{Binding SinglePrepackEditable}"
CellStyleSelector
=
"{StaticResource SingleEditableToBrushSelector}"
>
<
telerik:GridViewMaskedInputColumn.AggregateFunctions
>
<
telerik:SumFunction
/>
</
telerik:GridViewMaskedInputColumn.AggregateFunctions
>
</
telerik:GridViewMaskedInputColumn
>
<
telerik:GridViewDataColumn
Header
=
"Imploded"
ColumnGroupName
=
"Single"
DataMemberBinding
=
"{Binding SingleImploded}"
HeaderTextAlignment
=
"Center"
Width
=
"100"
IsGroupable
=
"False"
GroupFooterCellStyle
=
"{StaticResource RadGridViewGroupFooterCellStyle}"
IsReadOnly
=
"True"
>
<
telerik:GridViewDataColumn.AggregateFunctions
>
<
telerik:SumFunction
/>
</
telerik:GridViewDataColumn.AggregateFunctions
>
</
telerik:GridViewDataColumn
>
<
telerik:GridViewDataColumn
Header
=
"Exploded"
ColumnGroupName
=
"Single"
DataMemberBinding
=
"{Binding SingleExploded}"
HeaderTextAlignment
=
"Center"
Width
=
"100"
IsGroupable
=
"False"
GroupFooterCellStyle
=
"{StaticResource RadGridViewGroupFooterCellStyle}"
IsReadOnly
=
"True"
>
<
telerik:GridViewDataColumn.AggregateFunctions
>
<
telerik:SumFunction
/>
<
views:SingleUnitTotalUnitsPercent
Caption
=
"% "
ResultFormatString
=
"{}{0:0.00}"
/>
</
telerik:GridViewDataColumn.AggregateFunctions
>
</
telerik:GridViewDataColumn
>
<
telerik:GridViewDataColumn
Header
=
"Exploded"
ColumnGroupName
=
"Bulk"
DataMemberBinding
=
"{Binding BulkExploded}"
HeaderTextAlignment
=
"Center"
Width
=
"100"
IsGroupable
=
"False"
GroupFooterCellStyle
=
"{StaticResource RadGridViewGroupFooterCellStyle}"
IsReadOnly
=
"True"
>
<
telerik:GridViewDataColumn.AggregateFunctions
>
<
telerik:SumFunction
/>
<
views:BulkUnitTotalUnitsPercent
Caption
=
"% "
ResultFormatString
=
"{}{0:0.00}"
/>
</
telerik:GridViewDataColumn.AggregateFunctions
>
</
telerik:GridViewDataColumn
>
<
telerik:GridViewDataColumn
Header
=
"Exploded"
ColumnGroupName
=
"TotalUnits"
DataMemberBinding
=
"{Binding TotalUnitsExploded}"
HeaderTextAlignment
=
"Center"
Width
=
"100"
IsGroupable
=
"False"
GroupFooterCellStyle
=
"{StaticResource RadGridViewGroupFooterCellStyle}"
IsReadOnly
=
"True"
>
<
telerik:GridViewDataColumn.AggregateFunctions
>
<
telerik:SumFunction
/>
<
views:TotalUnitsPercent
Caption
=
"% "
ResultFormatString
=
"{}{0:0.00}"
/>
</
telerik:GridViewDataColumn.AggregateFunctions
>
</
telerik:GridViewDataColumn
>
<
telerik:GridViewDataColumn
Header
=
"Total"
ColumnGroupName
=
"UnitsPostReg"
DataMemberBinding
=
"{Binding TotalUnitsPostReg}"
HeaderTextAlignment
=
"Center"
Width
=
"100"
IsGroupable
=
"False"
GroupFooterCellStyle
=
"{StaticResource RadGridViewGroupFooterCellStyle}"
IsReadOnly
=
"True"
>
<
telerik:GridViewDataColumn.AggregateFunctions
>
<
telerik:SumFunction
/>
<
views:TotalUnitsPostRegPercent
Caption
=
"% "
ResultFormatString
=
"{}{0:0.00}"
/>
</
telerik:GridViewDataColumn.AggregateFunctions
>
</
telerik:GridViewDataColumn
>
<
telerik:GridViewDataColumn
Header
=
"Split"
ColumnGroupName
=
"UnitsPostReg"
HeaderTextAlignment
=
"Center"
Width
=
"100"
IsGroupable
=
"False"
IsReadOnly
=
"True"
IsVisible
=
"{Binding ShowSplitColumn}"
>
</
telerik:GridViewDataColumn
>
</
telerik:RadGridView.Columns
>
<
telerik:RadGridView.GroupDescriptors
>
<
telerik:ColumnGroupDescriptor
Column
=
"{Binding Columns[\DistributionCenter\], ElementName=PackRecommendationTotal}"
SortDirection
=
"Ascending"
/>
</
telerik:RadGridView.GroupDescriptors
>
</
telerik:RadGridView
>
<
telerik:RadGridView
x:Name
=
"PackRecommendation"
AutoGenerateColumns
=
"False"
IsReadOnly
=
"False"
RowIndicatorVisibility
=
"Collapsed"
GridLinesVisibility
=
"Vertical"
ShowGroupPanel
=
"False"
ItemsSource
=
"{Binding PackRecommendationList, Mode=TwoWay}"
ShowGroupFooters
=
"True"
Grid.Row
=
"1"
Grid.Column
=
"0"
ShowColumnHeaders
=
"False"
RowEditEnded
=
"radGridView_RowEditEnded"
CellEditEnded
=
"PackRecommendation_CellEditEnded"
ValidatesOnDataErrors
=
"InViewMode"
CanUserDeleteRows
=
"False"
RowStyleSelector
=
"{StaticResource totalUnitsExplodeStyle}"
>
<
telerik:RadGridView.ColumnGroups
>
<
telerik:GridViewColumnGroup
Name
=
"Size"
Header
=
"Pack Type"
HeaderStyle
=
"{StaticResource RadGridViewHeaderGroupStyle}"
/>
<
telerik:GridViewColumnGroup
Name
=
"Multi"
Header
=
"Multi"
HeaderStyle
=
"{StaticResource RadGridViewHeaderGroupStyle}"
/>
<
telerik:GridViewColumnGroup
Name
=
"Single"
Header
=
"Single"
HeaderStyle
=
"{StaticResource RadGridViewHeaderGroupStyle}"
/>
<
telerik:GridViewColumnGroup
Name
=
"Bulk"
Header
=
"Bulk"
HeaderStyle
=
"{StaticResource RadGridViewHeaderGroupStyle}"
/>
<
telerik:GridViewColumnGroup
Name
=
"TotalUnits"
Header
=
"Total Units"
HeaderStyle
=
"{StaticResource RadGridViewHeaderGroupStyle}"
/>
<
telerik:GridViewColumnGroup
Name
=
"UnitsPostReg"
Header
=
"UnitsPostReg"
HeaderStyle
=
"{StaticResource RadGridViewHeaderGroupStyle}"
/>
</
telerik:RadGridView.ColumnGroups
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
x:Name
=
"distributionCenterGridView"
DataMemberBinding
=
"{Binding DistributionCenter}"
UniqueName
=
"DistributionCenter"
IsGroupable
=
"True"
ShowColumnWhenGrouped
=
"False"
>
<
telerik:GridViewDataColumn.GroupHeaderTemplate
>
<
DataTemplate
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
TextBlock
Text
=
"{Binding Group.Key, StringFormat='DC #\{0:C\}'}"
/>
</
StackPanel
>
</
DataTemplate
>
</
telerik:GridViewDataColumn.GroupHeaderTemplate
>
</
telerik:GridViewDataColumn
>
<
telerik:GridViewDataColumn
Header
=
"Size"
ColumnGroupName
=
"Size"
DataMemberBinding
=
"{Binding SizeType}"
HeaderTextAlignment
=
"Center"
Width
=
"100"
IsGroupable
=
"False"
GroupFooterCellStyle
=
"{StaticResource RadGridViewGroupFooterCellStyleTotal}"
IsReadOnly
=
"True"
ValidatesOnDataErrors
=
"None"
>
<
telerik:GridViewDataColumn.AggregateFunctions
>
<
views:Total
/>
<
views:TotalPercent
/>
</
telerik:GridViewDataColumn.AggregateFunctions
>
</
telerik:GridViewDataColumn
>
<
telerik:GridViewDataColumn
Header
=
"Prepack"
ColumnGroupName
=
"Multi"
DataMemberBinding
=
"{Binding MultiPrePack}"
HeaderTextAlignment
=
"Center"
Width
=
"100"
IsGroupable
=
"False"
GroupFooterCellStyle
=
"{StaticResource RadGridViewGroupFooterCellStyle}"
IsReadOnly
=
"True"
ValidatesOnDataErrors
=
"None"
>
<
telerik:GridViewDataColumn.AggregateFunctions
>
<
telerik:SumFunction
/>
</
telerik:GridViewDataColumn.AggregateFunctions
>
</
telerik:GridViewDataColumn
>
<
telerik:GridViewMaskedInputColumn
Header
=
"Imploded"
ColumnGroupName
=
"Multi"
DataMemberBinding
=
"{Binding MultiImploded, Mode=TwoWay}"
HeaderTextAlignment
=
"Center"
Width
=
"100"
IsGroupable
=
"False"
GroupFooterCellStyle
=
"{StaticResource RadGridViewGroupFooterCellStyle}"
MaskType
=
"Numeric"
>
<
telerik:GridViewMaskedInputColumn.AggregateFunctions
>
<
telerik:SumFunction
/>
</
telerik:GridViewMaskedInputColumn.AggregateFunctions
>
</
telerik:GridViewMaskedInputColumn
>
<
telerik:GridViewDataColumn
Header
=
"Exploded"
ColumnGroupName
=
"Multi"
DataMemberBinding
=
"{Binding MultiExploded}"
HeaderTextAlignment
=
"Center"
Width
=
"100"
IsGroupable
=
"False"
GroupFooterCellStyle
=
"{StaticResource RadGridViewGroupFooterCellStyle}"
IsReadOnly
=
"True"
ValidatesOnDataErrors
=
"None"
>
<
telerik:GridViewDataColumn.AggregateFunctions
>
<
telerik:SumFunction
/>
<
views:MultiUnitTotalUnitsPercent
Caption
=
"% "
ResultFormatString
=
"{}{0:0.00}"
/>
</
telerik:GridViewDataColumn.AggregateFunctions
>
</
telerik:GridViewDataColumn
>
<
telerik:GridViewDataColumn
Header
=
"Prepack"
ColumnGroupName
=
"Single"
DataMemberBinding
=
"{Binding SinglePrepack}"
HeaderTextAlignment
=
"Center"
Width
=
"100"
IsGroupable
=
"False"
GroupFooterCellStyle
=
"{StaticResource RadGridViewGroupFooterCellStyle}"
IsReadOnly
=
"True"
ValidatesOnDataErrors
=
"None"
>
</
telerik:GridViewDataColumn
>
<
telerik:GridViewMaskedInputColumn
Header
=
"Imploded"
ColumnGroupName
=
"Single"
DataMemberBinding
=
"{Binding SingleImploded, Mode=TwoWay}"
HeaderTextAlignment
=
"Center"
Width
=
"100"
IsGroupable
=
"False"
GroupFooterCellStyle
=
"{StaticResource RadGridViewGroupFooterCellStyle}"
MaskType
=
"Numeric"
>
<
telerik:GridViewMaskedInputColumn.AggregateFunctions
>
<
telerik:SumFunction
/>
</
telerik:GridViewMaskedInputColumn.AggregateFunctions
>
</
telerik:GridViewMaskedInputColumn
>
<
telerik:GridViewDataColumn
Header
=
"Exploded"
ColumnGroupName
=
"Single"
DataMemberBinding
=
"{Binding SingleExploded}"
HeaderTextAlignment
=
"Center"
Width
=
"100"
IsGroupable
=
"False"
GroupFooterCellStyle
=
"{StaticResource RadGridViewGroupFooterCellStyle}"
IsReadOnly
=
"True"
ValidatesOnDataErrors
=
"None"
>
<
telerik:GridViewDataColumn.AggregateFunctions
>
<
telerik:SumFunction
/>
<
views:SingleUnitTotalUnitsPercent
Caption
=
"% "
ResultFormatString
=
"{}{0:0.00}"
/>
</
telerik:GridViewDataColumn.AggregateFunctions
>
</
telerik:GridViewDataColumn
>
<
telerik:GridViewMaskedInputColumn
Header
=
"Exploded"
ColumnGroupName
=
"Bulk"
DataMemberBinding
=
"{Binding BulkExploded}"
HeaderTextAlignment
=
"Center"
Width
=
"100"
IsGroupable
=
"False"
GroupFooterCellStyle
=
"{StaticResource RadGridViewGroupFooterCellStyle}"
IsReadOnly
=
"False"
MaskType
=
"Numeric"
>
<
telerik:GridViewMaskedInputColumn.AggregateFunctions
>
<
telerik:SumFunction
/>
<
views:BulkUnitTotalUnitsPercent
Caption
=
"% "
ResultFormatString
=
"{}{0:0.00}"
/>
</
telerik:GridViewMaskedInputColumn.AggregateFunctions
>
</
telerik:GridViewMaskedInputColumn
>
<
telerik:GridViewDataColumn
Header
=
"Exploded"
ColumnGroupName
=
"TotalUnits"
DataMemberBinding
=
"{Binding TotalUnitsExploded}"
HeaderTextAlignment
=
"Center"
Width
=
"100"
IsGroupable
=
"False"
GroupFooterCellStyle
=
"{StaticResource RadGridViewGroupFooterCellStyle}"
IsReadOnly
=
"True"
ValidatesOnDataErrors
=
"None"
>
<
telerik:GridViewDataColumn.AggregateFunctions
>
<
telerik:SumFunction
/>
<
views:TotalUnitsPercent
Caption
=
"% "
ResultFormatString
=
"{}{0:0.00}"
/>
</
telerik:GridViewDataColumn.AggregateFunctions
>
</
telerik:GridViewDataColumn
>
<
telerik:GridViewDataColumn
Header
=
"Total"
ColumnGroupName
=
"UnitsPostReg"
DataMemberBinding
=
"{Binding TotalUnitsPostReg}"
HeaderTextAlignment
=
"Center"
Width
=
"100"
IsGroupable
=
"False"
GroupFooterCellStyle
=
"{StaticResource RadGridViewGroupFooterCellStyle}"
IsReadOnly
=
"True"
ValidatesOnDataErrors
=
"None"
>
<
telerik:GridViewDataColumn.AggregateFunctions
>
<
telerik:SumFunction
/>
<
views:TotalUnitsPostRegPercent
Caption
=
"% "
ResultFormatString
=
"{}{0:0.00}"
/>
</
telerik:GridViewDataColumn.AggregateFunctions
>
</
telerik:GridViewDataColumn
>
<
telerik:GridViewDataColumn
Header
=
"Split"
ColumnGroupName
=
"UnitsPostReg"
HeaderTextAlignment
=
"Center"
Width
=
"100"
IsGroupable
=
"False"
IsReadOnly
=
"True"
ValidatesOnDataErrors
=
"None"
IsVisible
=
"{Binding ShowSplitColumn}"
>
<
telerik:GridViewDataColumn.AggregateFunctions
>
<
views:TotalUnitsPostRegDC
Caption
=
"TotalDC"
/>
<
views:TotalUnitsPostRegDCPercent
Caption
=
"TotalDCPercent"
/>
</
telerik:GridViewDataColumn.AggregateFunctions
>
<
telerik:GridViewDataColumn.Footer
>
<
StackPanel
Orientation
=
"Vertical"
>
<
ItemsControl
ItemsSource
=
"{Binding}"
VerticalAlignment
=
"Center"
ItemTemplateSelector
=
"{StaticResource aggregateTemplateSelectorStyle}"
>
<
ItemsControl.ItemsPanel
>
<
ItemsPanelTemplate
>
<
StackPanel
Orientation
=
"Vertical"
/>
</
ItemsPanelTemplate
>
</
ItemsControl.ItemsPanel
>
</
ItemsControl
>
</
StackPanel
>
</
telerik:GridViewDataColumn.Footer
>
</
telerik:GridViewDataColumn
>
</
telerik:RadGridView.Columns
>
<
telerik:RadGridView.GroupDescriptors
>
<
telerik:ColumnGroupDescriptor
Column
=
"{Binding Columns[\DistributionCenter\], ElementName=PackRecommendation}"
SortDirection
=
"Ascending"
/>
</
telerik:RadGridView.GroupDescriptors
>
</
telerik:RadGridView
>
</
Grid
>
Thank you.
I am afraid that with the supplied information I cannot figure out what is going on. May I ask you to open a new support ticket where you can attach a sample project. I will debug it on my side and I will assist you further.
Regards,
Yoan
Telerik
Hello, Yoan.
Unfortunately I can't paste it. Anyway, when I tested it in a new project, it worked. But when I do the same thing in my actual project, the TextBox doesn't show.
Could this particular template selector be overridden by some other style that I have?
It could be overridden if you are setting the ItemTemplate of the ItemsControl. Please check in your application for this code.
Regards,
Yoan
Telerik
Yoan,
that was my mistake. I was using a footer, when, actually, what I needed was a GroupFooter. So, by using the code below, it worked:
<
telerik:GridViewDataColumn.GroupFooterTemplate
>
<
DataTemplate
>
<
StackPanel
>
<
ItemsControl
ItemsSource
=
"{Binding}"
VerticalAlignment
=
"Center"
ItemTemplateSelector
=
"{StaticResource aggregateTemplateSelectorStyle}"
/>
</
StackPanel
>
</
DataTemplate
>
</
telerik:GridViewDataColumn.GroupFooterTemplate
>
Thanks a lot for your help, I really appreciate it!