Created
June 18, 2012 07:10
-
-
Save pinzolo/2947240 to your computer and use it in GitHub Desktop.
DataGrid に入力可能な ComboBox を配置する
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Window x:Class="MktSys.Gui.InputableDataGridComboBoxWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
Title="DataGrid に入力可能な ComboBox を配置する" Height="525" Width="300"> | |
<Grid> | |
<DataGrid Name="dataGrid" ItemsSource="{Binding Collection}" AutoGenerateColumns="False" CanUserAddRows="False"> | |
<DataGrid.Columns> | |
<DataGridTemplateColumn CanUserReorder="False" CanUserResize="False" CanUserSort="False" Header="タイプ"> | |
<DataGridTemplateColumn.CellTemplate> | |
<DataTemplate> | |
<TextBlock Text="{Binding Path=Type}" /> | |
</DataTemplate> | |
</DataGridTemplateColumn.CellTemplate> | |
<DataGridTemplateColumn.CellEditingTemplate> | |
<DataTemplate> | |
<ComboBox IsEditable="True" Text="{Binding Path=Type}" ItemsSource="{Binding Path=Candidates}" /> | |
</DataTemplate> | |
</DataGridTemplateColumn.CellEditingTemplate> | |
</DataGridTemplateColumn> | |
</DataGrid.Columns> | |
</DataGrid> | |
</Grid> | |
</Window> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment