Create Dialog does not show

3 posts, 1 answers
  1. Dusan
    Dusan avatar
    2 posts
    Member since:
    Oct 2011

    Posted 30 Aug 2012 Link to this post

    Greetings,

    I have a problem with RadScheduleView (WPF). I am starting with it and I have read from you documentation that if I make double click on the schedule view then "create dialog" should appear but i does not. Edit dialog and Delete dialog for existing event will appear but create dialog never shows. I have very easy application. I just put RadScheduleView from toolbox and made binding.

    You can see it at the bottom

    Could you tell me what I am doing wrong?

    Thanks

    Dusan Hudecek

    MainWindows.xaml:

    <Window x:Class="SchedulerWPF2.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="350" Width="525" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <Grid>
    <telerik:RadScheduleView AppointmentsSource="{Binding Appointments}" HorizontalAlignment="Left" Margin="10,10,0,0" Name="radScheduleView1" VerticalAlignment="Top">
    <telerik:RadScheduleView.ViewDefinitions>
    <telerik:DayViewDefinition />
    <telerik:WeekViewDefinition />
    <telerik:MonthViewDefinition />
    <telerik:TimelineViewDefinition />
    </telerik:RadScheduleView.ViewDefinitions>
    </telerik:RadScheduleView>
    </Grid>
    </Window>

    MainWindow.xaml.cs:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows;
    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.Collections.ObjectModel;

    using Telerik.Windows.Controls.ScheduleView;
    using Telerik.Windows.Controls;
    using Telerik.Windows.Data;

    namespace SchedulerWPF2
    {
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
    public DataContext dc = new DataContext();
    public RadObservableCollection<IAppointment> Appointments { get { return dc.Appointments; } set { dc.Appointments = value; } }

    public MainWindow()
    {
    InitializeComponent();

    dc.Appointments = new RadObservableCollection<IAppointment>();
    this.DataContext = dc;

    Appointment a = new Appointment();
    a.Start = DateTime.Now;
    a.End = DateTime.Now.AddHours(1);
    a.Subject = "test";

    dc.Appointments.Add(a);
    }
    }

    public class DataContext
    {
    public RadObservableCollection<IAppointment> Appointments { get; set; }
    }
    }

  2. Answer
    Yana
    Admin
    Yana avatar
    4554 posts

    Posted 03 Sep 2012 Link to this post

    Hello Dusan,

    Could you please change the AppointmentsSource of the ScheduleVIew to be of type RadObservableCollection<Appointment> instead of RadObservableCollection<IAppointment> (just do not use the interface here) ?

    Let us know whether this helps.

    Greetings,
    Yana
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Dusan
    Dusan avatar
    2 posts
    Member since:
    Oct 2011

    Posted 03 Sep 2012 Link to this post

    Greetings,

    thank you for your help.

    It is working now.

Back to Top