첨부 소스 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170

▶ XAML

<Grid
    xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
    xmlns:local="clr-namespace:HowToBindingToCollectionOfColumns">
    <Grid.Resources>
        <local:TotalSummaryInformationCollection x:Key="TotalSummaryInformationCollectionKey" />
        <DataTemplate x:Key="TotalSummaryDataTemplateKey">
            <ContentControl>
                <dxg:GridSummaryItem
                    FieldName="{Binding Path=(dx:DependencyObjectExtensions.DataContext).FieldName, RelativeSource={RelativeSource Self}}" 
                    SummaryType="{Binding Path=(dx:DependencyObjectExtensions.DataContext).SummaryItemType, RelativeSource={RelativeSource Self}}" />
            </ContentControl>
        </DataTemplate>
    </Grid.Resources>
    <dxg:GridControl x:Name="gridControl" 
        TotalSummarySource="TotalSummaryInformationCollectionKey"
        TotalSummaryGeneratorTemplate="TotalSummaryDataTemplateKey">
        <dxg:GridControl.View>
            <dxg:TableView x:Name="tableKey" />
        </dxg:GridControl.View>
    </dxg:GridControl>
</Grid>

 

728x90

 

▶ C#

using System.Collections.ObjectModel;

using DevExpress.Data;

...

/// <summary>
/// 그리드 SUMMARY 항목 정보
/// </summary>
public class GridSummaryItemInformation
{
    //////////////////////////////////////////////////////////////////////////////////////////////////// Property
    ////////////////////////////////////////////////////////////////////////////////////////// Public

    #region 필드명 - FieldName

    /// <summary>
    /// 필드명
    /// </summary>
    public string FieldName { get; set; }

    #endregion

    #region SUMMARY 항목 타입 - SummaryItemType

    /// <summary>
    /// SUMMARY 항목 타입
    /// </summary>
    public SummaryItemType SummaryItemType { get; set; }

    #endregion
}

...

/// <summary>
/// TOTAL SUMMARY 정보 컬렉션
/// </summary>
public class TotalSummaryInformationCollection : ObservableCollection<SummaryItemInformation>
{
    ...
}

 

728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요