Posted 15 years ago
by Andy Hardin
Version: 9.1.0500
Platform: .NET 3.5
Environment: Windows 7 (64-bit)
We have a case where there is a DoubleEditBox which is initially disabled and doesn't have any value (bound to a property with a null value). When the control is enabled, we can not type any values into it.
Here is a window with a checkbox to enable and disable the controls.Here is what I was able to do with the sample code.
1. Check the checkbox to enable the controls
The first DoubleEditBox without any value in it can not be edited, but the second one with an initial value can.
2. Click on the first DoubleEditBox so it no longer displays "No value"
3. Uncheck Enabled to disable the controls
4. Check Enabled to enable the controls
Now you can edit the values in both controls.
Here is a window with a checkbox to enable and disable the controls.
<Window x:Class="ActiproBug.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:editors="http://schemas.actiprosoftware.com/winfx/xaml/editors"
Title="Window1" Height="300" Width="300">
<StackPanel>
<CheckBox Content="Enabled" x:Name="enabler" />
<editors:DoubleEditBox Name="doubleEditBox1" IsEnabled="{Binding Path=IsChecked, ElementName=enabler}" />
<editors:DoubleEditBox Name="doubleEditBox2" Value="0" Format="C" IsEnabled="{Binding Path=IsChecked, ElementName=enabler}" />
</StackPanel>
</Window>
1. Check the checkbox to enable the controls
The first DoubleEditBox without any value in it can not be edited, but the second one with an initial value can.
2. Click on the first DoubleEditBox so it no longer displays "No value"
3. Uncheck Enabled to disable the controls
4. Check Enabled to enable the controls
Now you can edit the values in both controls.