<DataGrid x:Name="dgTime" AutoGenerateColumns="False" CanUserAddRows="True" MinHeight="50" Grid.Row="1">
<DataGrid.Columns>
<DataGridTextColumn Header="时间" Width="Auto" Binding="{Binding Time}"/>
<DataGridTextColumn Header="名称" Width="Auto" Binding="{Binding Name}"/>
<DataGridTemplateColumn Header="值" Width="160" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Width="160" HorizontalAlignment="Right" VerticalAlignment="Center" TextAlignment="Right" Text="{Binding Value, Mode=TwoWay}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<TextBox Text="{Binding Value, Mode=TwoWay}" >
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
后台cs 给了个数据源dgTime.ItemsSource = ValueList;
IsReadOnly="False" 加上就可以了