728x90
728x170
▶ Employee.cs
namespace TestProject
{
/// <summary>
/// 직원
/// </summary>
public class Employee
{
//////////////////////////////////////////////////////////////////////////////////////////////////// Property
////////////////////////////////////////////////////////////////////////////////////////// Public
#region 이름 - FirstName
/// <summary>
/// 이름
/// </summary>
public string FirstName { get; set; }
#endregion
#region 성 - LastName
/// <summary>
/// 성
/// </summary>
public string LastName { get; set; }
#endregion
#region 직업 - Occupation
/// <summary>
/// 직업
/// </summary>
public string Occupation { get; set; }
#endregion
}
}
728x90
▶ EmployeeCollection.cs
using System.Collections.ObjectModel;
namespace TestProject
{
/// <summary>
/// 직원 컬렉션
/// </summary>
public class EmployeeCollection : ObservableCollection<Employee>
{
}
}
300x250
▶ MainWindow.xaml
<Window
x:Class="TestProject.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid"
xmlns:local="clr-namespace:TestProject"
Width="600"
Height="450"
Title="컬럼 설정하기">
<Window.Resources>
<local:EmployeeCollection x:Key="EmployeeObservableCollectionKey">
<local:Employee FirstName="Jenny" LastName="Beland" Occupation="Writer" />
<local:Employee FirstName="Francois" LastName="Carignan" Occupation="Developer" />
<local:Employee FirstName="Pascal" LastName="Bourque" Occupation="Developer" />
<local:Employee FirstName="Michel" LastName="Fortin" Occupation="Developer" />
<local:Employee FirstName="Marc" LastName="Laroche" Occupation="Developer" />
<local:Employee FirstName="Pierre-Luc" LastName="Ledoux" Occupation="Developer" />
<local:Employee FirstName="Mathieu" LastName="Drimonakos" Occupation="TechnicalSupport" />
<local:Employee FirstName="Catherine" LastName="Sauzede" Occupation="Infograph" />
</local:EmployeeCollection>
<xcdg:DataGridCollectionViewSource x:Key="DataGridCollectionViewSourceKey"
ItemType="{x:Type local:Employee}"
AutoCreateItemProperties="False"
Source="{StaticResource EmployeeObservableCollectionKey}"
CreatingNewItem="DataGridCollectionViewSource_CreatingNewItem"
CommittingNewItem="DataGridCollectionViewSource_CommittingNewItem"
CancelingNewItem="DataGridCollectionViewSource_CancelingNewItem">
<xcdg:DataGridCollectionViewSource.ItemProperties>
<xcdg:DataGridItemProperty Name="FirstName" Title="이름" />
<xcdg:DataGridItemProperty Name="LastName" Title="성" />
</xcdg:DataGridCollectionViewSource.ItemProperties>
</xcdg:DataGridCollectionViewSource>
</Window.Resources>
<Grid>
<xcdg:DataGridControl x:Name="dataGridControl"
ItemsSource="{Binding Source={StaticResource DataGridCollectionViewSourceKey}}" />
</Grid>
</Window>
728x90
그리드형(광고전용)
'XCeed > WPF' 카테고리의 다른 글
[XCEED/WPF] DataGridControl 엘리먼트 : 복합 셀 에디터 제공하기 (0) | 2015.09.07 |
---|---|
[XCEED/WPF] DataGridControl 엘리먼트 : 단순 셀 에디터 제공하기 (0) | 2015.09.07 |
[XCEED/WPF] DataGridControl 엘리먼트 : 라우팅 편집 이벤트 처리하기 (0) | 2015.09.06 |
[XCEED/WPF] DataGridControl 엘리먼트 : 현재 셀인 경우 편집 모드 들어가기 (0) | 2015.09.06 |
[XCEED/WPF] DataGridControl 엘리먼트 : 언바운드 데이터 제공하기 (0) | 2015.09.06 |
[XCEED/WPF] DataGridControl 엘리먼트 : 추가 행 초기화 하기 (0) | 2015.09.06 |
[XCEED/WPF] DataGridControl 엘리먼트 : 추가 프로세스 수동 처리하기 (0) | 2015.09.05 |
[XCEED/WPF] DataGridControl 엘리먼트 : 선택 항목 삭제하기 (0) | 2015.09.05 |
[XCEED/WPF] DataGridControl 엘리먼트 : 그룹핑, 정렬 사용하기 (0) | 2015.09.05 |
[XCEED/WPF] DataGridControl 엘리먼트 : 현재 항목에서 값 구하기 (0) | 2015.09.05 |