DoubleClick to create appointment doesn't work?

13 posts, 0 answers
  1. Carl Björnberg
    Carl Björnberg avatar
    7 posts
    Member since:
    Sep 2009

    Posted 28 Mar 2011 Link to this post

    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
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 28 Mar 2011 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Carl Björnberg
    Carl Björnberg avatar
    7 posts
    Member since:
    Sep 2009

    Posted 28 Mar 2011 Link to this post

    Hi Yana,

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

    Best regards,
    Windev
  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 28 Mar 2011 Link to this post

    Hello Windev,

    Thank you, we'll review  the ticket.

    Greetings,
    Yana
    the Telerik team
  6. newbie
    newbie avatar
    15 posts
    Member since:
    Oct 2010

    Posted 28 Apr 2011 Link to this post

    I was just experiencing this problem.
    I solved it by adding a default constructor to my custom Appointment class.

    Cheers!
  7. ThomasJ
    ThomasJ avatar
    11 posts
    Member since:
    Dec 2007

    Posted 30 Jun 2011 Link to this post

    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?

  8. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 01 Jul 2011 Link to this post

    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
  9. ThomasJ
    ThomasJ avatar
    11 posts
    Member since:
    Dec 2007

    Posted 01 Jul 2011 Link to this post

    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;
     
     
            }
        }
    }
  10. ThomasJ
    ThomasJ avatar
    11 posts
    Member since:
    Dec 2007

    Posted 01 Jul 2011 Link to this post

    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;
        }
    }
  11. ThomasJ
    ThomasJ avatar
    11 posts
    Member since:
    Dec 2007

    Posted 01 Jul 2011 Link to this post

    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.
  12. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 05 Jul 2011 Link to this post

    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
  13. ThomasJ
    ThomasJ avatar
    11 posts
    Member since:
    Dec 2007

    Posted 06 Jul 2011 Link to this post

    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 ;)
  14. Eric
    Eric avatar
    2 posts
    Member since:
    Sep 2010

    Posted 27 Aug 2015 in reply to newbie Link to this post

    newbie, your post saved me
Back to Top
UI for WPF is Visual Studio 2017 Ready