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

Edit appointment dialog

7 Answers 345 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Josh
Top achievements
Rank 1
Josh asked on 06 Mar 2013, 09:36 PM
Is there a method to make the edit appointment dialog completely custom? If this is not possible is there a way to force the schedule view to refresh after an appointment has been edited out side of the dialog shown? We have tried to set the EditDialogStyle to a custom template but it does not give us the desired results it displays the exact same as before.

Thanks!

7 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 11 Mar 2013, 01:27 PM
Hello,

Setting the EditDialogStyle is the correct way to change the dialog of the ScheduleView.
Could you please let us know the exact problems you experience. If you could give us some more details about your scenario it will be very helpful for providing you with the best solution for your case.

More information how to replace the dialogs in the ScheduleView, you could find in this help article: http://www.telerik.com/help/wpf/radscheduleview-features-customizing-dialog-windows.html

Greetings,
Konstantina
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Josh
Top achievements
Rank 1
answered on 11 Mar 2013, 10:40 PM
We are using the schedule view to schedule events with-in a simulation. the simulation lasts for about an hour in most cases. The events have nothing to do with calendar dates or the other stuff built into the schedule view. So we tried to make our custom dialog into a control template and set the style of the edit dialog in code behind. It shows the regular dialog.

If there a way to force the schedule view to refresh? When ever we change an appointment in code it is not reflected on the timeline unless the user is interacting with the timeline.
0
Yana
Telerik team
answered on 14 Mar 2013, 09:24 AM
Hello Josh,

In general setting EditAppointmentDialogStyle property of the ScheduleView should set the EditAppointmentDialog to be the customized one.  We're not aware of any issues with this approach, it is explained in this help article and demonstrated in ScheduleView Custom Appointment and Validation online example at WPF Demos.

In order to edit the appointments in the code, you should use the approach described in this help topic.

Hope this helps.

Kind regards,
Yana
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Josh
Top achievements
Rank 1
answered on 04 Apr 2013, 02:26 PM
Hi,

We have been able to update the timeline using the commit and that works great. However we still can not get our custom dialogs to work correctly. the standard appointment dialog always displays.

 We are doing the following:
private void RadScheduleView_ShowDialog(object sender, Telerik.Windows.Controls.ShowDialogEventArgs e)
       {
           if (e.DialogViewModel is AppointmentDialogViewModel)
           {
 
               try
               {
                   if (((AppointmentDialogViewModel)e.DialogViewModel).Occurrence.Appointment is EventViewModel)
                   {
                       if (eventsTimeline.BeginEdit(((AppointmentDialogViewModel)e.DialogViewModel).Occurrence.Appointment))
                       {
                           EventType et = (EventType)Enum.Parse(typeof(EventType), ((AppointmentDialogViewModel)e.DialogViewModel).Occurrence.Appointment.Resources[0].ToString());
                           DisplayEventEditingWindow(et, ((EventViewModel)((AppointmentDialogViewModel)e.DialogViewModel).Occurrence.Appointment).Event);
 
                       }
                   }
               }
               catch (NullReferenceException)
               {
 
 
               }
           }
       }

The templates look as follows
  <ControlTemplate x:Key="EditAppointmentTemplateAudio" TargetType="schedule:SchedulerDialog">
        <ControlTemplate.Resources>
            <utl:FullFilePathToFileNameConverter x:Key="fullPathToFileName"></utl:FullFilePathToFileNameConverter>
            <utl:SecondsToFormatedTimeConverter x:Key="timeConverter"></utl:SecondsToFormatedTimeConverter>
            <utl:BoolToAudioTextConverter x:Key="AudioPlayButtonText"></utl:BoolToAudioTextConverter>
        </ControlTemplate.Resources>
        <Grid DataContext="{Binding AudioEventViewModel, Source={StaticResource Locator}}">
            <Grid.RowDefinitions>
                <RowDefinition Height="25"></RowDefinition>
                <RowDefinition Height="70"></RowDefinition>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition Width="300"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <uc:EventNameControl Grid.ColumnSpan="2" DataContext="{Binding}"></uc:EventNameControl>
            <StackPanel Orientation="Horizontal" Grid.Row="1" Margin="5" Grid.ColumnSpan="2">
                <diControls:DILabel VerticalAlignment="Top">Filename:</diControls:DILabel>
                <StackPanel>
                    <diControls:DIComboBox ItemsSource="{Binding AudioFiles}" SelectedItem="{Binding SelectedAudioFile}" MinWidth="150">
                        <ComboBox.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Converter={StaticResource fullPathToFileName} }"></TextBlock>
                            </DataTemplate>
                        </ComboBox.ItemTemplate>
                    </diControls:DIComboBox>
                    <StackPanel Orientation="Horizontal">
                        <diControls:DILabel>File Duration:</diControls:DILabel>
                        <diControls:DILabel Content="{Binding Duration, Converter={StaticResource timeConverter}}"></diControls:DILabel>
                    </StackPanel>
                </StackPanel>
            </StackPanel>
            <diControls:DIButton Grid.Column="1" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="10" Command="{Binding PreviewSelectedFileCommand}" Content="{Binding IsAudioFilePlaying, Converter={StaticResource AudioPlayButtonText}}"></diControls:DIButton>
            <diControls:DICheckBox Grid.Row="2" Margin="10" Foreground="White" IsChecked="{Binding IsEventLooping}">Loop Audio File?</diControls:DICheckBox>
            <StackPanel Grid.Column="1" Grid.Row="2">
                <diControls:DILabel HorizontalAlignment="Center">Event Volume:</diControls:DILabel>
                <telerik:RadSlider Style="{StaticResource PercentSlider}" Value="{Binding VolumeLevel}" Margin="5"></telerik:RadSlider>
            </StackPanel>
            <uc:EventCreationButtons Grid.Row="3" Grid.ColumnSpan="2" DataContext="{Binding}"></uc:EventCreationButtons>
        </Grid>
    </ControlTemplate>
 
    <ControlTemplate x:Key="EditAppointmentTemplateLighting" TargetType="schedule:SchedulerDialog">
        <ControlTemplate.Resources>
            <Style TargetType="diControls:DIRadioButton">
                <Setter Property="GroupName" Value="LightColor" />
            </Style>
            <utl:EnumMatchToBooleanConverter x:Key="enumConverter" />
        </ControlTemplate.Resources>
        <Grid DataContext="{Binding LightingEventViewModel, Source={StaticResource Locator}}">
            <StackPanel>
                <uc:EventNameControl DataContext="{Binding}" />
                <StackPanel Orientation="Horizontal" Margin="0,5,0,5">
                    <diControls:DILabel>Light Color:</diControls:DILabel>
                    <diControls:DIRadioButton DIRadioButtonStyle="ToggleButton" IsChecked="{Binding CurrentLightColor,Converter={StaticResource enumConverter},ConverterParameter=White}" Content="White" Width="70" />
                    <diControls:DIRadioButton DIRadioButtonStyle="ToggleButton" IsChecked="{Binding CurrentLightColor,Converter={StaticResource enumConverter},ConverterParameter=Red}" Content="Red"  Width="70" />
                    <diControls:DIRadioButton DIRadioButtonStyle="ToggleButton" IsChecked="{Binding CurrentLightColor,Converter={StaticResource enumConverter},ConverterParameter=Blue}" Content="Blue" Width="70" />
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <diControls:DILabel>Strobe:</diControls:DILabel>
                    <diControls:DILabel Width="50">
                        <TextBlock TextWrapping="WrapWithOverflow">Always On</TextBlock>
                    </diControls:DILabel>
                    <telerik:RadSlider Style="{StaticResource PercentSlider}" TickPlacement="None" Width="150" Value="{Binding Event.StrobeRate}"></telerik:RadSlider>
                    <diControls:DILabel Width="50" Margin="5,0,0,0">
                        <TextBlock TextWrapping="WrapWithOverflow">Fast Strobe</TextBlock>
                    </diControls:DILabel>
                </StackPanel>
                <uc:EventCreationButtons></uc:EventCreationButtons>
            </StackPanel>
        </Grid>
    </ControlTemplate>
 
<Style x:Key="EditAppointmentDialogAudioStyle" TargetType="telerik:SchedulerDialog">
        <Setter Property="Foreground" Value="White" />
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="Background" Value="{x:Static diControls:DIColorDefinitions.DefaultWindowBackground}" />
        <Setter Property="Width" Value="600" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template" Value="{StaticResource EditAppointmentTemplateAudio}" />
    </Style>
 
    <Style x:Key="EditAppointmentDialogLightingStyle" TargetType="telerik:SchedulerDialog">
        <Setter Property="Foreground" Value="White" />
        <Setter Property="Background" Value="{x:Static diControls:DIColorDefinitions.DefaultWindowBackground}" />
        <Setter Property="Width" Value="560" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template" Value="{StaticResource EditAppointmentTemplateLighting}" />
    </Style>

The display function is as follows
private bool DisplayEventEditingWindow(EventType et, ScenarioEvent se)
       {
           if (se == null)
           {
               throw new NullReferenceException("Scenairo event is null");
           }
 
           if (et == EventType.Audio)
           {
               eventsTimeline.EditAppointmentDialogStyle = (Style)App.Current.FindResource("EditAppointmentDialogAudioStyle");
           }
           else if (et == EventType.Odor)
           {
              // eventWindow = new OdorEventWindow();
 
           }
           else if (et == EventType.Lighting)
           {
               eventsTimeline.EditAppointmentDialogStyle = (Style)App.Current.FindResource("EditAppointmentDialogLightingStyle");
 
           }
           else if (et == EventType.Smoke)
           {
               //eventWindow = new SmokeEventWindow();
           }
           else
           {
               throw new ArgumentException("Invalid event type to display");
           }
 
 
           return true;
 
       }
0
Karthik
Top achievements
Rank 1
answered on 20 May 2016, 11:47 AM

Hello,

How can I populate my second combobox based on first combobox selected item/value in Custom EditAppointment using MVVM?

And how to save the Combobox data fromCustom EditAppointment. I have tried using this function radScheduleView_AppointmentCreated(object sender, Telerik.Windows.Controls.AppointmentCreatedEventArgs e), but i am not getting the combobox data in AppointmentCreatedEventArgs.

Attached an screenshot for scenario.

0
Karthik
Top achievements
Rank 1
answered on 10 Jun 2016, 05:58 AM

Hello,

Please anybody can help me to get sort it out.

Thanks in advance :)

0
Karthik
Top achievements
Rank 1
answered on 18 Jul 2016, 10:54 AM
Hello?

Anybody outhere?

I need help!
Tags
ScheduleView
Asked by
Josh
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Josh
Top achievements
Rank 1
Yana
Telerik team
Karthik
Top achievements
Rank 1
Share this question
or