Editors With No Value Won't Accept Focus

Editors for WPF Forum

Posted 10 years ago by Andy Ver Murlen
Avatar
We have noticed that editors (DoubleEditBox, Int32EditBox) that allow nulls and are displaying the "No Value" text will not accept focus if you click on the "No Value" text. Please see the sample code below. If you click an Int32EditBox off to the side of the "No Value" text, tab between the text boxes, or click on the text box if it already has a value, it properly focuses on the text box. However, if you click on the "No Value" text the text box changes from "No Value" to the prompt indicators, but does not receive focus. You must click the box a second time to focus on it.

This is especially dangerous if the text box resides on a form with multiple controls, because the previously selected control will retain focus and as a result, all keystrokes the user presses will be entered into the previously selected control...thinking they are entering them into the text box they just clicked on.

<Window 
    x:Class="Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Editors="clr-namespace:ActiproSoftware.Windows.Controls.Editors;assembly=ActiproSoftware.Editors.Wpf30"
    Title="Window1"
    Width="600"
    Height="300"
    >
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <Editors:Int32EditBox
            Margin="3"
            Width="100"
            Height="21"
            HorizontalAlignment="Left"
            Value="{Binding Path=Price1, UpdateSourceTrigger=PropertyChanged}"
            Format="C"
            IsNullAllowed="True"
            />
        <Editors:Int32EditBox
            Margin="3"
            Grid.Row="1"
            Width="100"
            Height="21"
            HorizontalAlignment="Left"
            Value="{Binding Path=Price2, UpdateSourceTrigger=PropertyChanged}"
            Format="C"
            IsNullAllowed="True"
            />
    </Grid>
</Window>
[Modified at 08/25/2009 12:34 PM]

Comments (1)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Andy,

Thanks, we've fixed this for the next maintenance release.


Actipro Software Support

The latest build of this product (v2019.1 build 0682) was released 28 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.