■ ColumnBase 엘리먼트의 DisplayTemplate 속성을 사용해 컬럼 값 표시를 정의하는 ControlTemplate를 설정하는 방법을 보여준다.
▶ 예제 코드 (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 28 29 30 31 32 33 34 35 36 37 |
<dxg:GridColumn FieldName="OrderUnit"> <dxg:GridColumn.DisplayTemplate> <ControlTemplate> <ProgressBar Margin="2" Minimum="0" Maximum="50" Value="{Binding Path=DisplayText, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" /> </ControlTemplate> </dxg:GridColumn.DisplayTemplate> <dxg:GridColumn.EditTemplate> <ControlTemplate> <Grid VerticalAlignment="Center"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="30" /> </Grid.ColumnDefinitions> <Slider x:Name="PART_Editor" Grid.Column="0" Minimum="0" Maximum="50" Value="{Binding Path=EditValue, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource IntegerToDoubleValueConverterKey}}" /> <TextBlock Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black" TextWrapping="NoWrap" Text="{Binding EditValue, RelativeSource={RelativeSource TemplatedParent}}" /> </Grid> </ControlTemplate> </dxg:GridColumn.EditTemplate> </dxg:GridColumn> |