A clarification: The condition occurs when the raddatepicker is in an collapsed section of the page that is then made visible in response to some action (e.g. a button click). In the now visible panel, changing the date value by typing and clicking the update button does not update the selected date. you have to click the button a second time or you had to tab out of the control before clicking the update button. For some reason, there is no way for me to upload my sample project. So here's the xaml and code behind.
<
UserControl xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" x:Class="ShowRadDatePickerProblem.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:input="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
<Grid x:Name="LayoutRoot">
<StackPanel Background="AliceBlue" HorizontalAlignment="Center" Orientation="Vertical">
<input:RadDatePicker x:Name="rdpExpDate" Width="150" Height="24" HorizontalAlignment="Left" DisplayMode="MonthView" ></input:RadDatePicker>
<TextBlock Text="Enter a date, don't tab out, but click submit. Then enter a date, tab out, click submit. All works." Foreground="Black"></TextBlock>
<Button x:Name="submit" Content="Submit" Click="submit_Click" Width="150"></Button>
<TextBlock x:Name="txtResult" FontSize="14" Text="Selected Date In Textbox: " Foreground="Black"></TextBlock>
<TextBlock Text="Now click the show hidden grid button and try the same operations. You have to click the update button twice for the value to change or tab out." Foreground="Black"></TextBlock>
<Button x:Name="btnShowHiddenGrid" Content="Show Hidden Grid" Width="150" Click="btnShowHiddenGrid_Click"></Button>
</StackPanel>
<Border x:Name="borderSelectedItem" Visibility="Collapsed" Margin="3,3,3,3" CornerRadius="10" Grid.Column="0" Grid.Row="2" Canvas.Left="200" Canvas.Top="200" Width="400" Height="200" Background="AntiqueWhite">
<Grid x:Name="gridSelectedItem" Margin="3,1,3,1">
<Grid.RowDefinitions>
<RowDefinition Height="34"></RowDefinition>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="30"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Border CornerRadius="5" Margin="3,2,3,1" Background="CadetBlue" Grid.Row="0" Grid.ColumnSpan="2" Grid.Column="0" Height="24" >
<TextBlock x:Name="Title2" Foreground="Azure" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="12" Text="Edit Date Test"></TextBlock>
</Border>
<TextBlock x:Name="txtEffDate" Text="Effective Date" Height="24" Grid.Row="2" Grid.Column="0" FontSize="12" Margin="10,0,0,0"></TextBlock>
<input:RadDatePicker x:Name="rdpEffDate2" Width="150" Height="24" HorizontalAlignment="Left" Grid.Row="2" Grid.Column="1" DisplayMode="MonthView" ></input:RadDatePicker>
<StackPanel Width="390" Height="34" Orientation="Horizontal" HorizontalAlignment="Center" Margin="5,0,0,0" Grid.Row="5" Grid.ColumnSpan="2">
<Button x:Name="btnUpdateWf" Content="Update" VerticalContentAlignment="Center" Width="85" Height="24" Margin="2,2,10,2" ClickMode="Press" Click="btnUpdateWf_Click"></Button>
</StackPanel>
</Grid>
</Border>
</Grid>
</
UserControl>
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Net;
using
System.Windows;
using
System.Windows.Controls;
using
System.Windows.Documents;
using
System.Windows.Input;
using
System.Windows.Media;
using
System.Windows.Media.Animation;
using
System.Windows.Shapes;
using
Telerik.Windows.Input;
namespace
ShowRadDatePickerProblem
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
rdpExpDate.SelectedDate =
DateTime.Today;
}
private void submit_Click(object sender, RoutedEventArgs e)
{
txtResult.Text =
"Selected Date In Textbox: " + rdpExpDate.SelectedDate.Value.ToShortDateString();
}
private void btnShowHiddenGrid_Click(object sender, RoutedEventArgs e)
{
borderSelectedItem.Visibility =
Visibility.Visible;
rdpEffDate2.SelectedDate =
DateTime.Today;
}
private void btnUpdateWf_Click(object sender, RoutedEventArgs e)
{
txtResult.Text =
"Selected Date In Textbox: " + rdpEffDate2.SelectedDate.Value.ToShortDateString();
}
}
}
Thanks.
Mark