This is a migrated thread and some comments may be shown as answers.

Default value

1 Answer 76 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
Xaria D
Top achievements
Rank 1
Xaria D asked on 26 Oct 2010, 09:03 AM
I have a DtaeTime Picker in my application as follows

<Input:RadDateTimePicker x:Name="dateTimePicker" Width="150" Margin="3,0,0,0" DateTimeWatermarkContent="DateTime" SelectedValue="{Binding StartDateTime, Mode=TwoWay}"   VerticalAlignment="Center" SelectionChanged="dateTimePicker_SelectionChanged" />

and in the code behind
  private DateTime _startDateTime = DateTime.Now;
       public DateTime StartDateTime
       {
           get
           {
               return _startDateTime ;
           }
           set
           {
                
               if (_startDateTime != value)
               {
                   _startDateTime = value;
                   OnPropertyChanged("StartDateTime");
               }
           }
       }
 
public event PropertyChangedEventHandler PropertyChanged;
       private void OnPropertyChanged(string propertyName)
       {
           if (this.PropertyChanged != null)
           {
               this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
           }
       }

But when I run the app, there is no value set for The DateTimePicker control

1 Answer, 1 is accepted

Sort by
0
George
Telerik team
answered on 29 Oct 2010, 08:36 AM
Hi Xaria,

I tried to reproduce the problem, but to no avail. Everything works fine. Attached you can find the sample. Please, let me know if I am doing something wrong.

All the best,
George
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
DateTimePicker
Asked by
Xaria D
Top achievements
Rank 1
Answers by
George
Telerik team
Share this question
or