This question is locked. New answers and comments are not allowed.
Hi Telerik,
I have a RadDatePicker and its SelectedDate value is binding with BeginDate property. What I want to do is to update other RadDatePicker when this RadDatePicker's value gets changed.
However, after SelectionChanged event is invoked, I still get the old date value inside the Command. When the event get finished, the property is finally updated. So I am not able to update the other RadDatePicker after SelectionChanged is invoked.
Could you please to help me with this? Thanks.
Hao L
Below is my codes:
----------------------------------------------------------------
//View [xaml]:
I have a RadDatePicker and its SelectedDate value is binding with BeginDate property. What I want to do is to update other RadDatePicker when this RadDatePicker's value gets changed.
However, after SelectionChanged event is invoked, I still get the old date value inside the Command. When the event get finished, the property is finally updated. So I am not able to update the other RadDatePicker after SelectionChanged is invoked.
Could you please to help me with this? Thanks.
Hao L
Below is my codes:
----------------------------------------------------------------
//View [xaml]:
<telerik:RadDatePicker Name="BeginDatePicker" Width="100" telerik:StyleManager.Theme="Metro" SelectedDate="{Binding Source={StaticResource ClrStmtControlViewModel}, Path=BeginDate, Mode=TwoWay}" IsReadOnly="False">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding Source={StaticResource ClrStmtControlViewModel}, Path=OnBeginDatePickerSelectionChangedCommand, Mode=OneWay}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</telerik:RadDatePicker>
//View Model:
//Property
private DateTime _BeginDate;
public DateTime BeginDate
{
get { return _BeginDate; }
set
{
_BeginDate = value;
RaisePropertyChanged("BeginDate");
}
}
//Command
private readonly ICommand _OnBeginDatePickerSelectionChangedCommand;
public ICommand OnBeginDatePickerSelectionChangedCommand
{
get
{
return _OnBeginDatePickerSelectionChangedCommand;
}
}
private void BeginDatePicker_SelectionChanged()
{
AppMessaging.UpdateBeginDateMessage.Send(BeginDate); //BUT THE DATE IS NOT CHANGED HERE!!!
}