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

Why are some things not working?

2 Answers 143 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Ronald
Top achievements
Rank 1
Ronald asked on 21 Mar 2011, 08:10 AM
Hi,

could it be, that there are some "bugs" in Schedule View?

First i tried following:

<radSchedulerView:RadScheduleView FontSize="18" x:Name="_sView" Grid.Column="0" Grid.RowSpan="2">
 
            <radSchedulerView:RadScheduleView.ViewDefinitions>
                <radSchedulerView:DayViewDefinition DayStartTime="00:00:00"  DayEndTime="23:59:59"  MinTimeRulerExtent="1800" />
                <radSchedulerView:WeekViewDefinition DayStartTime="00:00:00"  DayEndTime="23:59:59" MinTimeRulerExtent="1800"/>
                <!-- MonthView has fixed tick lengths and extents! -->
                <radSchedulerView:MonthViewDefinition />
                <radSchedulerView:TimelineViewDefinition DayStartTime="00:00:00"  DayEndTime="23:59:59"  MinorTickLength="1day" />
            </radSchedulerView:RadScheduleView.ViewDefinitions>
        </radSchedulerView:RadScheduleView>



 _sView.AppointmentEditing +=
                    new EventHandler<AppointmentEditingEventArgs>(OnScheduler_AppointmentEditing);
_sView.AppointmentCreating +=
                    new EventHandler<AppointmentCreatingEventArgs>(OnScheduler_AppointmentCreating);



private void OnScheduler_AppointmentCreating(object sender, AppointmentCreatingEventArgs e)
{         
            e.Cancel = true;
}
 
 
private void OnScheduler_AppointmentDeleting(object sender, AppointmentDeletingEventArgs e)
        {
            e.Cancel = true;
        }

Every time I double click an Appoinment in Schedule View, the Edit Dialog appears although I have set e.Cancel=true. The same thing happens, if I double click a Time Slot. I think e.Cancel=true should prevent showing the edit dialog?

Second thing is also not working: In the Control RadScheduler following worked:


_sView.MouseLeftButtonUp += new MouseButtonEventHandler(OnScheduler_MouseLeftButtonUp);


private void OnScheduler_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            MccmAppointment selectedAppointment = _sView.SelectedAppointment as MccmAppointment;
 
...
...
          
        }

But in Schedule View, the event Mouse Left Button Up does not fire, I i click on an Appointment. But it fires, if I click on any other UIElement. I can't figure out why?

Please help me asap!

Thanks,
Ronald

2 Answers, 1 is accepted

Sort by
0
Ronald
Top achievements
Rank 1
answered on 21 Mar 2011, 08:26 AM
I have to mention that I am using Telerik controls from Q1 2011.
0
Valeri Hristov
Telerik team
answered on 22 Mar 2011, 12:01 PM
Hello Ronald,

If you want to prevent a specific dialog from appearing you should cancel the ShowDialog event. The event args contain a property called DialogViewModel which can be used to determine which dialog is to be opened. For example for the appointment dialog the view model is AppointmentDialogViewModel.

The Mouse events are not fired because we are handling them when we do something in our handler. For example when the ScheduleView changes the selection, it handles the corresponding Mouse event that caused the change. I would recommend to avoid handling low level events such as the mouse or drag-drop events because usually there are better ways to get your job done and it could lead to unexpected results.

Best wishes,
Valeri Hristov
the Telerik team
Tags
ScheduleView
Asked by
Ronald
Top achievements
Rank 1
Answers by
Ronald
Top achievements
Rank 1
Valeri Hristov
Telerik team
Share this question
or