Posted 14 years ago
by Aled Hughes
-
Principal Software Engineer,
Control Techniques Ltd.
Version: 11.1.0545

Hi,
I'm using a DoubleEditBox within the CellEditingTemplate of a DataGrid column but have an issue in that I have to press the enter key twice to commit the edit. I.e. I select the cell, press F2 to go to edit mode then I have to tab to be able to type a value in, then I have to press ENTER twice to commit the value.
This doesn't happen with the standard TextBox. How can I avoid having to press enter twice?
I'm using a DoubleEditBox within the CellEditingTemplate of a DataGrid column but have an issue in that I have to press the enter key twice to commit the edit. I.e. I select the cell, press F2 to go to edit mode then I have to tab to be able to type a value in, then I have to press ENTER twice to commit the value.
This doesn't happen with the standard TextBox. How can I avoid having to press enter twice?
<DataGrid ItemsSource="{Binding Items}" AutoGenerateColumns="False">
<DataGrid.Columns>
<DataGridTemplateColumn Header="APEdit" Width="80">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Value}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ae:DoubleEditBox Minimum="0.0" Maximum="9999.9" Value="{Binding Value}" SpinnerVisibility="Visible" PartValueCommitTriggers="SpinnerChangeOrEnterKeyDown" />
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>