반응형
grid summary
count, min, max, sum, average

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | < Page xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x = "http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc = "http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d = "http://schemas.microsoft.com/expression/blend/2008" xmlns:local = "clr-namespace:WpfSample.DevTest" xmlns:dxlc = "http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol" xmlns:dx = "http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:Serialization = "clr-namespace:DevExpress.Xpf.LayoutControl.Serialization;assembly=DevExpress.Xpf.LayoutControl.v17.2" xmlns:dxe = "http://schemas.devexpress.com/winfx/2008/xaml/editors" xmlns:dxg = "http://schemas.devexpress.com/winfx/2008/xaml/grid" x:Class = "WpfSample.DevTest.Grid06Summary" mc:Ignorable = "d" d:DesignHeight = "800" d:DesignWidth = "1280" Title = "Grid01" > < StackPanel Margin = "0,10,10,10" > < dxlc:LayoutControl HorizontalAlignment = "Stretch" VerticalAlignment = "Stretch" Orientation = "Vertical" > < dxlc:LayoutGroup Header = "Button" View = "GroupBox" HorizontalAlignment = "Stretch" > < dx:SimpleButton x:Name = "btnSearch" Content = "Search" HorizontalAlignment = "Left" Click = "Button_Click" /> </ dxlc:LayoutGroup > </ dxlc:LayoutControl > < dxlc:LayoutControl HorizontalAlignment = "Stretch" VerticalAlignment = "Stretch" Orientation = "Vertical" > < dxlc:LayoutGroup Header = "Grid" View = "GroupBox" HorizontalAlignment = "Stretch" Height = "500" > < dxg:GridControl x:Name = "gcGrid" SelectionMode = "Cell" > < dxg:GridControl.Columns > < dxg:GridColumn FieldName = "SalesOrderID" Header = "SalesOrderID" Width = "100" /> < dxg:GridColumn FieldName = "CustomerID" Header = "CustomerID" Width = "100" /> < dxg:GridColumn FieldName = "[Name]" Header = "[Name]" Width = "100" /> < dxg:GridColumn FieldName = "SubTotal" Header = "SubTotal" Width = "100" > < dxg:GridColumn.EditSettings > < dxe:TextEditSettings DisplayFormat = "#,###.00" MaskType = "Numeric" /> </ dxg:GridColumn.EditSettings > </ dxg:GridColumn > < dxg:GridColumn FieldName = "TaxAmt" Header = "TaxAmt" Width = "100" > < dxg:GridColumn.EditSettings > < dxe:TextEditSettings DisplayFormat = "#,###.00" MaskType = "Numeric" /> </ dxg:GridColumn.EditSettings > </ dxg:GridColumn > < dxg:GridColumn FieldName = "Freight" Header = "Freight" Width = "100" > < dxg:GridColumn.EditSettings > < dxe:TextEditSettings DisplayFormat = "#,###.00" MaskType = "Numeric" /> </ dxg:GridColumn.EditSettings > </ dxg:GridColumn > < dxg:GridColumn FieldName = "TotalDue" Header = "TotalDue" Width = "100" > < dxg:GridColumn.EditSettings > < dxe:TextEditSettings DisplayFormat = "#,###.00" MaskType = "Numeric" /> </ dxg:GridColumn.EditSettings > </ dxg:GridColumn > < dxg:GridColumn FieldName = "Total" UnboundType = "Decimal" MinWidth = "130" Width = "1.3*" UnboundExpression = "[TaxAmt] + [Freight] + [TotalDue]" > < dxg:GridColumn.EditSettings > < dxe:TextEditSettings DisplayFormat = "#,###.00" MaskType = "Numeric" /> </ dxg:GridColumn.EditSettings > </ dxg:GridColumn > </ dxg:GridControl.Columns > < dxg:GridControl.TotalSummary > < dxg:GridSummaryItem SummaryType = "Count" Alignment = "Right" DisplayFormat = "#,###" /> < dxg:GridSummaryItem FieldName = "SubTotal" SummaryType = "Count" ShowInColumn = "SubTotal" DisplayFormat = "#,###" /> < dxg:GridSummaryItem FieldName = "TaxAmt" SummaryType = "Min" ShowInColumn = "TaxAmt" DisplayFormat = "#,###.00" /> < dxg:GridSummaryItem FieldName = "Freight" SummaryType = "Max" ShowInColumn = "Freight" DisplayFormat = "#,###.00" /> < dxg:GridSummaryItem FieldName = "TotalDue" SummaryType = "Sum" ShowInColumn = "TotalDue" DisplayFormat = "#,###.00" /> < dxg:GridSummaryItem FieldName = "Total" SummaryType = "Average" ShowInColumn = "Total" DisplayFormat = "#,###.00" /> </ dxg:GridControl.TotalSummary > < dxg:GridControl.View > < dxg:TableView x:Name = "view" NavigationStyle = "Row" ShowTotalSummary = "True" ShowFixedTotalSummary = "True" /> </ dxg:GridControl.View > </ dxg:GridControl > </ dxlc:LayoutGroup > </ dxlc:LayoutControl > </ StackPanel > </ Page > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using BIZ.Common.Dac; using DTO.Common.Cocktail; namespace WpfSample.DevTest { /// <summary> /// Grid06Summary.xaml에 대한 상호 작용 논리 /// </summary> public partial class Grid06Summary : Page { public Grid06Summary() { InitializeComponent(); GetBindGrid(); } private void GetBindGrid() { //var data = (new CommonCodeDAO()).Z_UP_COCKTAIL_LIST("dzl"); Dictionary< string , object > dic = new Dictionary< string , object >(); dic.Add( "param1" , "111" ); var data = ( new ADOConnect()).GetDataSet( "AdventureWorks2016" , "Z_UP_SALES_ORDER_LIST" , dic); gcGrid.ItemsSource = data.Tables[0]; } private void Button_Click( object sender, RoutedEventArgs e) { GetBindGrid(); } } } |
docs.devexpress.com/WPF/DevExpress.Xpf.Data.SummaryType
아래 SummaryType Enum을 보면... average가 avg 인데... 17.2 버전에서는 Average로 해야된다.
문서의 버전은 20.2인거 같은데.. 20.2에서 확인을 해보지 않아서.. 모르겠다.
참고바람.
SummaryType Enum
Lists values specifying the aggregate function types.
Namespace: DevExpress.Xpf.Data
Assembly: DevExpress.Xpf.Core.v20.2.dll
#Declaration
public enum SummaryType
#Members
NameDescription
Sum |
The sum of all values in a column. |
Avg |
The average value of a column. |
Min |
The minimum value in a column. |
Max |
The maximum value in a column. |
Count |
The record count. |
Custom |
반응형
'WPF - DevExpress' 카테고리의 다른 글
WPF & DevExpress GridControl RowColor #1 Basic (2) | 2021.03.30 |
---|---|
WPF & DevExpress GridControl Cell Merge (2) | 2021.03.29 |
WPF & DevExpress GridControl Drag & Drop (4) | 2021.03.27 |
WPF & DevExpress GridControl LookupEdit Dynamically change item source (6) | 2021.03.24 |
WPF & DevExpress GridControl LookupEdit & ComboBoxEdit (6) | 2021.03.22 |
댓글