■ DataGridControl 엘리먼트에서 배열을 바인딩하는 방법을 보여준다.
▶ 예제 코드 (XAML)
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 |
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid" x:Class="TestProject.MainWindow" Width="600" Height="450" Title="배열 바인딩 하기"> <Window.Resources> <x:Array x:Key="WeekDayArrayKey" Type="{x:Type s:String}"> <s:String>일요일</s:String> <s:String>월요일</s:String> <s:String>화요일</s:String> <s:String>수요일</s:String> <s:String>목요일</s:String> <s:String>금요일</s:String> <s:String>토요일</s:String> </x:Array> </Window.Resources> <Grid> <xcdg:DataGridControl x:Name="dataGridControl" ItemsSource="{StaticResource WeekDayArrayKey}" /> </Grid> </Window> |