I'd like to resolve a small quirk I've been having. It's not really a quirk but rather a behavior I'd like to change if possible.
If I use a {N:2} StringFormat/ConverterCulture, a TextBox is forced into having a decimal mark always (even during the process of inputting text). I mean, you can't delete the dot or the comma at all, you must be able to figure out you have to move to the next "field" of the number in order to edit the decimal points by either clicking with the mouse there or pressing "right".
Since that's uninituitive for most users, is there a way to avoid it without resorting to rewriting the formatters? I hope for something simple in the framework of the existing properties.
Example, a XAML TextBox bound to a DataGrid's cell,
<TextBox Name="TextBox1" Height="18" Margin="0,0,10,0" Text="{Binding SelectedItem[1], ConverterCulture=en-US, ElementName=Grid1, StringFormat={}{0:N2}, UpdateSourceTrigger=PropertyChanged}" Width="59" TextAlignment="Right" VerticalAlignment="Center" />
Added remarks after answers:
- UpdateSourceTrigger=PropertyChanged appears to be directly related to this behavior.
- I suspect that a true full solution might not be possible due to a logical conflict of wanting both to have true bidirectional updating and a user trying to intervene with new input at the same time.