Bug on IsEnabled for DatePicker

Apr 14, 2010 at 9:37 AM


I have a small problem with the datepicker and it's "isEnabled" property.

When I set the property in XAML this work perfectly.

                    <toolkit:DatePicker IsEnabled="False" Name='dp_birth' Height="23" HorizontalAlignment="Left" Margin="187,107,0,0" VerticalAlignment="Top" Width="120">                        
                            <Binding Path="date_birth" UpdateSourceTrigger="PropertyChanged">

But when I change it in C#, the "style" don't work : it's stay grey but we can edit it.

this.dp_birth.IsEnabled = true;
Apr 14, 2010 at 9:37 AM

Thanks in advance for your response.


May 3, 2010 at 10:17 AM

same issue for me

May 8, 2010 at 10:22 AM
D_Guidi wrote:

same issue for me

May be someone have a solution. I have found nothings


May 10, 2010 at 11:20 AM

Yip, same problem here and using Feb 10 release :(

Sep 2, 2010 at 10:00 AM

Same problem here using the Feb 2010 release, but I found a simple workaround.

You can add a <style> which highlights when a DatePicker control is disabled.
I've posted sample code here: 



Feb 10, 2011 at 1:35 AM

      add this code  on OnIsEnabledChanged below OnVisualStatePropertyChanged(dp) and recompile the toolkit..this should work

  if (!dp.IsEnabled)
                VisualStates.GoToState(dp, true, VisualStates.StateDisabled, VisualStates.StateNormal);
                VisualStates.GoToState(dp, true, VisualStates.StateNormal);

Aug 11, 2011 at 8:15 AM


 public class MyDatePicker : DatePicker
        public MyDatePicker()
            this.IsEnabledChanged += (o, e) => UpdateIsEnabledProperty(o as Control);

        private static void UpdateIsEnabledProperty(Control ui)
            if (ui == null)

            const string normal = "Normal";
            const string disabled = "Disabled";
            string name = ui.IsEnabled ? normal : disabled; 
            VisualStateManager.GoToState(ui, name , true);            

Using this you can avoid recompilation, unfortunately in some cases this doesn't work