Hello !
I want to Edit Numeric Values with 2 digits in an GridView.
My First Solution:
Using an GridViewDataColumn and set the CellEditTemplate to a
RadMaskedNumericInput like this (SelectionOnFocus="SelectAll" (Important!))
<telerik:GridViewDataColumn Header="Listenpreis" Width="80" TextAlignment="Right" HeaderTextAlignment="Right"
DataMemberBinding="{Binding Path=Listenpreis}" DataFormatString="F2">
<telerik:GridViewDataColumn.CellEditTemplate>
<DataTemplate>
<telerik:RadMaskedNumericInput Margin="0" SelectionOnFocus="SelectAll" HorizontalAlignment="Stretch"
Value="{Binding Path=Listenpreis, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}"
SpinMode="None"
FormatString="n2"/>
</DataTemplate>
</telerik:GridViewDataColumn.CellEditTemplate>
</telerik:GridViewDataColumn>
This works well for Editing, but the Enter Key doesn't work as expected to go to the next Row in the same Column.
I can Only change the Column with the Tab Key.
My Second Solution:
Using an GridViewMaskedInputColumn like this:
<telerik:GridViewMaskedInputColumn Header="Listenpreis3" Width="80" TextAlignment="Right" HeaderTextAlignment="Right"
MaskType="Numeric"
DataMemberBinding="{Binding Path=Listenpreis}" DataFormatString="{} {0:N2}" />
But here i'am missing the 2 Digits Mask on Editing and "SelectAll" on Enter the Cell.
How can i get this working as expected ?
I want to Edit Numeric Values with 2 digits in an GridView.
My First Solution:
Using an GridViewDataColumn and set the CellEditTemplate to a
RadMaskedNumericInput like this (SelectionOnFocus="SelectAll" (Important!))
<telerik:GridViewDataColumn Header="Listenpreis" Width="80" TextAlignment="Right" HeaderTextAlignment="Right"
DataMemberBinding="{Binding Path=Listenpreis}" DataFormatString="F2">
<telerik:GridViewDataColumn.CellEditTemplate>
<DataTemplate>
<telerik:RadMaskedNumericInput Margin="0" SelectionOnFocus="SelectAll" HorizontalAlignment="Stretch"
Value="{Binding Path=Listenpreis, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}"
SpinMode="None"
FormatString="n2"/>
</DataTemplate>
</telerik:GridViewDataColumn.CellEditTemplate>
</telerik:GridViewDataColumn>
This works well for Editing, but the Enter Key doesn't work as expected to go to the next Row in the same Column.
I can Only change the Column with the Tab Key.
My Second Solution:
Using an GridViewMaskedInputColumn like this:
<telerik:GridViewMaskedInputColumn Header="Listenpreis3" Width="80" TextAlignment="Right" HeaderTextAlignment="Right"
MaskType="Numeric"
DataMemberBinding="{Binding Path=Listenpreis}" DataFormatString="{} {0:N2}" />
But here i'am missing the 2 Digits Mask on Editing and "SelectAll" on Enter the Cell.
How can i get this working as expected ?