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

DoubleClick to create appointment doesn't work?

12 Answers 273 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Carl Björnberg
Top achievements
Rank 1
Carl Björnberg asked on 28 Mar 2011, 11:11 AM
Hi,

I'm migrating from RadScheduler to RadScheduleView but I can't get mouse double click to open the Create Appointment dialog. I've tried to create the a simple project where I'm only showing a RadScheduleView and a few appointments but nothing happens when I double click in the ScheduleView. In RadScheduler the AppointmentCreating event was fired when i double-clicked in the scheduler. Maybe I've missed something, but I don't know what. I tried looking at the demo app, where this functionality is working, but I can't see where my app differs from the demo.

I would be greatful if someone could give me a hint.

Best regards,
Windev

12 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 28 Mar 2011, 12:15 PM
Hi Windev,

This is strange - Create Appointment Dialog is supposed to open when you double click on the slot. Can you send us a simple project demonstrating the issue? You should open a support ticket and attach it there. Thanks in advance

Regards,
Yana
the Telerik team
0
Carl Björnberg
Top achievements
Rank 1
answered on 28 Mar 2011, 03:27 PM
Hi Yana,

I've opened a support ticket and attached my simple sample visual studio project.

Best regards,
Windev
0
Yana
Telerik team
answered on 28 Mar 2011, 04:25 PM
Hello Windev,

Thank you, we'll review  the ticket.

Greetings,
Yana
the Telerik team
0
newbie
Top achievements
Rank 1
answered on 28 Apr 2011, 08:36 PM
I was just experiencing this problem.
I solved it by adding a default constructor to my custom Appointment class.

Cheers!
0
ThomasJ
Top achievements
Rank 2
answered on 30 Jun 2011, 02:28 PM
Did you find out why this is happening. I am experiencing the same thing!

<telerik:RadScheduleView HorizontalAlignment="Stretch" Name="radScheduleView1" VerticalAlignment="Stretch" AppointmentsSource="{Binding Appointments}" FirstDayOfWeek="Monday" ActiveViewDefinitionIndex="1">

<telerik:RadScheduleView.ViewDefinitions>

 

<telerik:DayViewDefinition />

 

<telerik:WeekViewDefinition />

 

<telerik:MonthViewDefinition />

<telerik:TimelineViewDefinition />

</telerik:RadScheduleView.ViewDefinitions>

</telerik:RadScheduleView>

This is the aspx code of my sceduleview. This is in a ordinary wpf window and I'm using the MVVM pattern and my Appointments is defined in there. Appointments do show and I can double click them to edit but I cant create one by doubleclicking!

Any ideas?

0
Yana
Telerik team
answered on 01 Jul 2011, 08:05 AM
Hi Thomas,

The provided code is not enough for us to find the reason for the issue you're experiencing. Could you please send us more details which will help us reproduce the problem? Thanks in advance

Kind regards,
Yana
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
0
ThomasJ
Top achievements
Rank 2
answered on 01 Jul 2011, 08:28 AM
the Aspx file

<Window x:Class="TestScheduleView.MainWindow"
        Title="MainWindow" Height="696" Width="1036" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <Window.Resources>
         
    </Window.Resources>
    <Grid>
        <telerik:RadScheduleView HorizontalAlignment="Stretch" Name="radScheduleView1" VerticalAlignment="Stretch" AppointmentsSource="{Binding Appointments}" UseLayoutRounding="False" AppointmentEdited="radScheduleView1_AppointmentEdited">
            <telerik:RadScheduleView.ViewDefinitions>
                <telerik:DayViewDefinition />
                <telerik:WeekViewDefinition />
                <telerik:MonthViewDefinition />
                <telerik:TimelineViewDefinition />
            </telerik:RadScheduleView.ViewDefinitions>
        </telerik:RadScheduleView>
    </Grid>
</Window>

the aspx.cs file
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.ComponentModel;
using Telerik.Windows.Controls.ScheduleView;
 
namespace TestScheduleView
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindowViewModel viewModel;
        public MainWindow()
        {
            InitializeComponent();
            if (!DesignerProperties.GetIsInDesignMode(this))
            {
                this.viewModel = new MainWindowViewModel();
                this.Loaded += (s, e) => { this.DataContext = this.viewModel; };
 
                
 
            }
        }
 
        private void radScheduleView1_AppointmentEdited(object sender, Telerik.Windows.Controls.AppointmentEditedEventArgs e)
        {
            Appointment ap = (Appointment)e.Appointment;
 
 
        }
    }
}
0
ThomasJ
Top achievements
Rank 2
answered on 01 Jul 2011, 08:29 AM
Finally the viewmodel file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Telerik.Windows.Controls.ScheduleView;
using System.ComponentModel;
 
namespace TestScheduleView
{
    public class MainWindowViewModel: INotifyPropertyChanged
    {
        private IEnumerable<Appointment> appointments;
 
        public IEnumerable<Appointment> Appointments
        {
            get
            {
                return appointments;
            }
            set
            {
                appointments = value;
                OnPropertyChanged("Appointments");
            }
        }
 
 
        public MainWindowViewModel()
        {
            Appointment ap = new Appointment();
            ap.Subject = "Test";
            ap.Start = new DateTime(2011, 6, 30, 17, 30, 00);
            ap.End = new DateTime(2011, 6, 30, 18, 30, 00);
            Appointments = new[] { ap };
        }
 
 
        /// <summary>
        /// Helper methode for the implementation on IPropertyChanged interface
        /// </summary>
        /// <param name="propertyName"></param>
        private void OnPropertyChanged(string propertyName)
        {
            if (this.PropertyChanged != null)
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
        public event PropertyChangedEventHandler PropertyChanged;
    }
}
0
ThomasJ
Top achievements
Rank 2
answered on 01 Jul 2011, 08:35 AM
The doubleclick on an existing Appointment shows the edit dialog window. And I can break on the edited finnished Appointment :) So everything works as expected except for the new appointment dialog window. It does not show on doubleclick in a appointmentspot.

In the aspx file I've also tried setting and removing a number of different things including setting the datacontext attribute to binding and so forth...
I hope this is sufficient to reproduce the error. If not I can upload my project to a support ticket.
0
Yana
Telerik team
answered on 05 Jul 2011, 03:48 PM
Hello Thomas,

The reason for this issue is that you use IEnumarable as AppointmentSource. Please replace it with a ObservableCollection<Appointment> or other source that implements INotifyCollectionChanged. This should solve the problem:

private ObservableCollection<Appointment> appointments;
 
public ObservableCollection<Appointment> Appointments
{
   get
   {
      return appointments;
   }
   set
   {
      appointments = value;
      OnPropertyChanged("Appointments");
   }
}
  
  
public MainWindowViewModel()
{
    Appointment ap = new Appointment();
    ap.Subject = "Test";
    p.Start = new DateTime(2011, 6, 30, 17, 30, 00);
    ap.End = new DateTime(2011, 6, 30, 18, 30, 00);
    appointments = new ObservableCollection<Appointment>() { ap };
}


Regards,
Yana
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
0
ThomasJ
Top achievements
Rank 2
answered on 06 Jul 2011, 10:15 AM
I'm not quite shure the logic behind this but it works! Thanks a lot :)

Edit:
Ahh INotifyCollectionChanged not INotifyPropertyChanged so it reveal itself when you actually read the code ;)
0
Eric
Top achievements
Rank 1
answered on 27 Aug 2015, 05:43 PM
newbie, your post saved me
Tags
ScheduleView
Asked by
Carl Björnberg
Top achievements
Rank 1
Answers by
Yana
Telerik team
Carl Björnberg
Top achievements
Rank 1
newbie
Top achievements
Rank 1
ThomasJ
Top achievements
Rank 2
Eric
Top achievements
Rank 1
Share this question
or