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

RadCalendar control misbehaving - SelectionChanged fires two times on select of Same Date two times

1 Answer 67 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Pawan Sharma
Top achievements
Rank 1
Pawan Sharma asked on 26 Aug 2010, 02:29 PM
If we select same date in RadCalendar, Selectionchanged fires twice but if we don't select same date it fires only once. Moreover if keep on selecting the same date. the count of SelctionChanged kept increasing.

XAML File

<UserControl x:Class="RadControlsSilverlightApp1.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"
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
  <Grid x:Name="LayoutRoot">
        <telerik:RadCalendar  HorizontalAlignment="Left" Margin="136,133,0,0" Name="radCalendar1" VerticalAlignment="Top" />
    </Grid>
</UserControl>

Code Behind

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;

namespace RadControlsSilverlightApp1
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
            radCalendar1.SelectionChanged+=new Telerik.Windows.Controls.SelectionChangedEventHandler(radCalendar1_SelectionChanged);
        }

        private void radCalendar1_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangedEventArgs e)
        {
            MessageBox.Show("test");
        }
    }
}

 

 

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 27 Aug 2010, 12:44 PM
Hello Pawan Sharma,

This is the default control behavior. You can observe the SelectionChangedEventArgs property that will help you determining when an old value is removed or a new date is added Remove/Added to the collection. Let us know if you are experiencing any further problems.

Regards,
Kaloyan
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
General Discussions
Asked by
Pawan Sharma
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Share this question
or