Telerik Forums
UI for WPF Forum
0 answers
2 views

Hi.

I am trying to customize my month view for my special slots.

I can do it for daily and weekly, but for monthly it takes the whole slot. I want it to look like the appointments do... (i.e.: show the stack of slots if there are more than one...)

What am I doing wrong? Or cannot be done...

 

I am using Telerik UI for WPF R1 2023

 

Thanks in advance!

Richard
Top achievements
Rank 1
Iron
 updated question on 18 Mar 2024
1 answer
9 views

Hi,

We are using the scheduler in an old asp.net app (see attachment).

How do we set the background, foreground and border color for every single appointment/item.

For example: An Appointment/item now has the following properties:

            var app1 = new Appointment()
            {
                Subject = "Front-End Meeting",
                Start = DateTime.Today.AddHours(9),
                End = DateTime.Today.AddHours(10)
                ForeColor = "Red",
                BackColor = "Blue",
                BorderColor = "Black"
            };

Thanks and best regards,
Egbert

Martin Ivanov
Telerik team
 answered on 28 Feb 2024
0 answers
14 views

Hi, I would like to change style of schedulerdialogs in ScheduleView. For example, when I click on delete appointment button, this is the style I see:

But I want the style to look like this:

As you can see, the header of this dialog looks different. I am only able to achieve this look for Radwindow not for SchedulerDialog. Is there a way ro do it?

Thank you for your answer

 

 

T
Top achievements
Rank 1
 asked on 26 Feb 2024
1 answer
11 views
<utils:AppointmentStyleSelector x:Key="AppointmentStyleSelector">
    <utils:AppointmentStyleSelector.ArrivedAppointmentStyle>
        <Style TargetType="telerik:AppointmentItem">
            <Setter Property="Background" Value="Green"/>
        </Style>
    </utils:AppointmentStyleSelector.ArrivedAppointmentStyle>
    <utils:AppointmentStyleSelector.IndicatorAppointmentStyle>
        <Style TargetType="telerik:AppointmentItem">
            <Setter Property="Background" Value="Red"/>
        </Style>
    </utils:AppointmentStyleSelector.IndicatorAppointmentStyle>
</utils:AppointmentStyleSelector>

Martin Ivanov
Telerik team
 answered on 15 Jan 2024
0 answers
21 views

Hi,

 I’m trying to handle the drag and drop operation from a winforms control (RadGridView for now, can be RadTreeView or RadListView too) to the RadScheduleView WPF.

 I have overridden the ConvertDraggedData from ScheduleViewDragDropBehavior class.

 The event isn’t firing when I’m dragging a row from my winforms GridView over the schedule.

 Is there a way to convert dragged data from the grid in winforms that make the event fires in WPF?

 Or another way to achieve the expected behavior ?

 Thanks.

 Rémi

Fabrice
Top achievements
Rank 2
Iron
 asked on 22 Dec 2023
1 answer
14 views

I think I have found i bug with selection with Alt-key on RadScheduleView.

I use a WeekViewDefinition as my active view definition. When I select a square by holding Alt-key while dragging the selection breaks if I have any group descriptions defined.
I have a minor tick length of 15 minutes. When my selection reaches the last tick of any day (after 23:45) the selection jumps to next day close to the time where my selection started.

I am attaching a video that illustrates the problem.

If I dont have any group description on my RadScheduleView I dont get this problem.

Here is my schedule view detinition:


        <telerik:RadScheduleView
            x:Name="ScheduleView"
            AppointmentsSource="{Binding Appointments}"
            VisibleRangeChangedCommand="{Binding VisibleRangeChangedCommand}"
            VisibleRangeChangedCommandParameter="{Binding VisibleRange, RelativeSource={RelativeSource Self}}"
            SnapAppointments="True"
            TodayButtonVisibility="Hidden"
            IsInlineEditingEnabled="False"
            NavigationHeaderVisibility="Collapsed"
            SpecialSlotsSource="{Binding SpecialSlots}"
            FirstVisibleTime="0:00"
            ResourceTypesSource="{Binding ResourceTypes}"
            TimeRulerItemStyleSelector="{StaticResource TimeRulerItemStyleSelector}"
            AppointmentStyleSelector="{StaticResource AppointmentItemStyleSelector}"
            ToolTipTemplate="{StaticResource AppointmentToolTipTemplate}"
            GroupHeaderStyleSelector="{StaticResource SchemaGroupHeaderStyleSelector}"
            GroupHeaderContentTemplateSelector="{StaticResource SchemaGroupHeaderContentTemplateSelector}">
            
            <b:Interaction.Behaviors>
                <schedules:PreventCloseDialogBehavior/>
                <behaviors:PreventAddScheduleDialogException/>
                <behaviors:FastAppointmentAddBehavior Appointments="{Binding Appointments}"/>
                <behaviors:FilterAppointmentsBehavior/>
            </b:Interaction.Behaviors>
            
            <telerik:RadScheduleView.ActiveViewDefinition>
                <telerik:WeekViewDefinition
                    MinTimeRulerExtent="200"
                    TimerulerMajorTickStringFormat="{}{0:%H}:{0:mm}"
                    GroupHeaderDateStringFormat="{}{0:ddd}"
                    ShowWeekGroupHeaders="False"
                    MinorTickLength="15min"
                    Orientation="Horizontal"
                    StretchGroupHeaders="True"
                    FirstDayOfWeek="Monday"
                    VisibleDays="7" />
                
            </telerik:RadScheduleView.ActiveViewDefinition>
            
            <telerik:RadScheduleView.DragDropBehavior> 
                <behaviors:ScheduleDragDropBehavior />
            </telerik:RadScheduleView.DragDropBehavior> 
            <telerik:RadScheduleView.SlotSelectionBehavior> 
                <behaviors:ScheduleSlotSelectionBehavior/> 
            </telerik:RadScheduleView.SlotSelectionBehavior> 

            <telerik:RadScheduleView.GroupDescriptionsSource>
                <telerik:GroupDescriptionCollection>
                    <telerik:DateGroupDescription/>
                    <telerik:ResourceGroupDescription ResourceType="Schedules" />
                </telerik:GroupDescriptionCollection>
            </telerik:RadScheduleView.GroupDescriptionsSource>
        </telerik:RadScheduleView>

Petar Mladenov
Telerik team
 answered on 01 Dec 2023
1 answer
23 views

Hi

I have created a behavior for quickly adding appointments on mouse up.

I have currently been using the SelectedSlot (Start/End) property of RadScheduleView to create an appointment, but now I discovered that when selecting with Alt-key down you can get the same Start/End selected over multiple days. When debugging I can see these intervals in the Slot.Infos property, but this property is internal so I can't access it.

Is there another way to find these intervals in the RadScheduleView?

Stenly
Telerik team
 answered on 24 Nov 2023
0 answers
35 views

Hi

I have a problem with rendering of the ScheduleView when I change VisibleRange. I use a WeekViewDefinition with a Horizontal orientation. In the handler of the VisibleRangeChangedCommand I replace the content of the binding source of the AppointmentsSource property. When I switch to a new week the new Appointments are not rendered correctly (see screenshot). When I resize my dialog containing the ScheduleView the ScheduleView is updated and rendered correctly.

I started to get this problem when I set the MinTimeRulerExtent property, so that I do not get a scrollbar on my ScheduleView. I guess applying the scrollbar forces an update of the ScheduleView.

Is there a way to force an update after the VisibleRangeChanged event to get the proper rendering?

I use the Windows8 theme and 2021.1.119 version of Telerik WPF components.

Here is the definition of my ScheduleView:

 

<UserControl
    x:Class="Tennotech.Hilding.Watchman.Presentation.Views.Schedules.ScheduleExceptionsDetailsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    xmlns:schedules="clr-namespace:Tennotech.Hilding.Watchman.Presentation.Views.Schedules"
    xmlns:dt="http://tennotech.com/desktop/xaml/2014"
    xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="300">
    
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="ScheduleResources.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            
            <telerik:OrientedAppointmentItemStyleSelector x:Key="AppointmentItemStyleSelector"> 
                <telerik:OrientedAppointmentItemStyleSelector.MonthViewStyle> 
                    <Style TargetType="telerik:AppointmentItem" BasedOn="{StaticResource AppointmentItemBaseStyle}"> 
                        <Setter Property="Margin" Value="2 1 2 0" /> 
                        <Setter Property="Background" Value="DarkSlateGray" />
                        <Setter Property="ToolTip" Value="{Binding Appointment.ToolTip}" />
                    </Style> 
                </telerik:OrientedAppointmentItemStyleSelector.MonthViewStyle> 

                <!-- This is the style used by schedules -->
                <telerik:OrientedAppointmentItemStyleSelector.HorizontalStyle> 
                    <Style TargetType="telerik:AppointmentItem" BasedOn="{StaticResource AppointmentItemBaseStyle}">
                        <Setter Property="Margin" Value="0 2 0 10" /> 
                        <Setter Property="Background" Value="#324245" /> 
                        <Setter Property="ToolTip" Value="{Binding Appointment.ToolTip}" />
                    </Style> 
                </telerik:OrientedAppointmentItemStyleSelector.HorizontalStyle>
                
                <telerik:OrientedAppointmentItemStyleSelector.VerticalStyle> 
                    <Style TargetType="telerik:AppointmentItem" BasedOn="{StaticResource AppointmentItemBaseStyle}"> 
                        <Setter Property="Template" Value="{StaticResource AppointmentItemVerticalControlTemplate}"/> 
                        <Setter Property="ResizeCursor" Value="SizeNS"></Setter> 
                        <Setter Property="Margin" Value="1 5 0 5" />
                        <Setter Property="Background" Value="Pink" /> 
                        <Setter Property="ToolTip" Value="{Binding Appointment.ToolTip}" />
                    </Style> 
                </telerik:OrientedAppointmentItemStyleSelector.VerticalStyle> 
            </telerik:OrientedAppointmentItemStyleSelector> 
            
            <DataTemplate x:Key="ToolTipTemplate"> 
                <Grid> 
                    <StackPanel> 
                        <StackPanel Orientation="Horizontal" Margin="0 0 0 0"> 
                            <TextBlock Text="{Binding Start, StringFormat='hh:mm tt'}" TextWrapping="Wrap" FontSize="12" /> 
                            <TextBlock Text=" - " FontSize="10" /> 
                            <TextBlock Text="{Binding End, StringFormat='hh:mm tt'}" TextWrapping="Wrap" FontSize="12" /> 
                        </StackPanel> 
                        <TextBlock Text="{Binding Start, StringFormat='dddd dd MMM yyyy'}" Margin="0 3" FontSize="12" /> 
                    </StackPanel> 
                </Grid> 
            </DataTemplate>
            
            <schedules:ScheduleSlotStyleSelector x:Key="SpecialSlotStyleSelector"> 
                <schedules:ScheduleSlotStyleSelector.ScheduleStyle> 
                    <Style TargetType="telerik:HighlightItem">
                         
                        <Setter Property="Template"> 
                            <Setter.Value> 
                                <ControlTemplate>
                                    <Grid Margin="-2 1 -2 1">
                                        <Border Background="Black"/>
                                        <Border BorderBrush="Gray" BorderThickness="1"/> 
                                    </Grid> 
                                </ControlTemplate> 
                            </Setter.Value> 
                        </Setter> 
                    </Style> 
                </schedules:ScheduleSlotStyleSelector.ScheduleStyle>
                
                <schedules:ScheduleSlotStyleSelector.HistoricStyle> 
                    <Style TargetType="telerik:HighlightItem">
                         
                        <Setter Property="Template"> 
                            <Setter.Value> 
                                <ControlTemplate>
                                    <Grid Margin="-2 1 -2 1">
                                        <Border Background="Transparent"/>
                                        <Border BorderBrush="Gray" BorderThickness="1"/> 
                                    </Grid> 
                                </ControlTemplate> 
                            </Setter.Value> 
                        </Setter> 
                    </Style> 
                </schedules:ScheduleSlotStyleSelector.HistoricStyle> 

            </schedules:ScheduleSlotStyleSelector> 
            
        </ResourceDictionary>
    </UserControl.Resources>

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>

        <!--
        SpecialSlotStyleSelector="{StaticResource SpecialSlotStyleSelector}"
        MouseOverHighlightStyle="{StaticResource MouseOverHighlightStyle}"
        SelectionHighlightStyle="{StaticResource SelectionHighlightStyle}"
        -->
        
        <telerik:RadScheduleView
            x:Name="ScheduleView"
            AppointmentsSource="{Binding Appointments}"
            VisibleRangeChangedCommand="{Binding VisibleRangeChangedCommand}"
            VisibleRangeChangedCommandParameter="{Binding VisibleRange, RelativeSource={RelativeSource Self}}"
            CurrentDate="{Binding CurrentDate, Mode=TwoWay}"
            SnapAppointments="True"
            TodayButtonVisibility="Hidden"
            IsInlineEditingEnabled="False"
            NavigationHeaderVisibility="Visible"
            SpecialSlotsSource="{Binding SpecialSlots}"
            FirstVisibleTime="0:00"
            ResourceTypesSource="{Binding ResourceTypes}"
            AppointmentStyleSelector="{StaticResource AppointmentItemStyleSelector}"
            GroupHeaderStyleSelector="{StaticResource SchemaGroupHeaderStyleSelector}"
            GroupHeaderContentTemplateSelector="{StaticResource SchemaGroupHeaderContentTemplateSelector}"
            ToolTipTemplate="{StaticResource ToolTipTemplate}"
            SpecialSlotStyleSelector="{StaticResource SpecialSlotStyleSelector}"
            MinTimeRulerExtent="200"
            >
            <!--
            MinTimeRulerExtent="200"
             -->
            
            <b:Interaction.Behaviors>
                <schedules:PreventCloseDialogBehavior/>
                <schedules:PreventAddScheduleDialogException/>
                <schedules:FastAppointmentAddBehavior Appointments="{Binding Appointments}"/>
                <schedules:FilterAppointmentsBehavior/>
            </b:Interaction.Behaviors>
            
            <telerik:RadScheduleView.DragDropBehavior> 
                <schedules:ScheduleDragDropBehavior />
            </telerik:RadScheduleView.DragDropBehavior>
            <telerik:RadScheduleView.SlotSelectionBehavior> 
                <schedules:ScheduleSlotSelectionBehavior/> 
            </telerik:RadScheduleView.SlotSelectionBehavior> 

            <telerik:RadScheduleView.ActiveViewDefinition>
                <telerik:WeekViewDefinition
                    TimerulerMajorTickStringFormat="{}{0:%H}:{0:mm}"
                    ShowWeekGroupHeaders="False"
                    MinorTickLength="15min"
                    Orientation="Horizontal"
                    StretchGroupHeaders="True"
                    FirstDayOfWeek="Monday"
                    VisibleDays="7" />
                
            </telerik:RadScheduleView.ActiveViewDefinition>

            <telerik:RadScheduleView.GroupDescriptionsSource>
                <telerik:GroupDescriptionCollection>
                    <telerik:DateGroupDescription/>
                    <telerik:ResourceGroupDescription ResourceType="Schedules" />
                </telerik:GroupDescriptionCollection>
            </telerik:RadScheduleView.GroupDescriptionsSource>
        </telerik:RadScheduleView>
        
        <DockPanel Grid.Column="1" Margin="20 0 0 0" MinWidth="300">
            <TextBlock Text="{dt:Text ScheduleExceptions}" DockPanel.Dock="Top" Style="{StaticResource Title}"/>

            <telerik:RadGridView
                x:Name="ScheduleGrid"
                DockPanel.Dock="Bottom"
                ItemsSource="{Binding ScheduleExceptions}"
                AutoExpandGroups="True"
                AutoGenerateColumns="False"
                CanUserFreezeColumns="False"
                CanUserReorderColumns="False"
                CanUserSelect="True"
                EnableRowVirtualization="True"
                GroupRenderMode="Flat"
                IsReadOnly="True"
                RowIndicatorVisibility="Collapsed"
                SelectionMode="Single"
                SelectionUnit="FullRow"
                ShowGroupPanel="False"
                dt:CommandBindingsBehavior.RegisterCommandBindings="{Binding CommandBindings}">
                
                <b:Interaction.Behaviors>
                    <schedules:RowDoubleClickBehavior Command="{Binding RowDoubleClickedCommand}"/>
                </b:Interaction.Behaviors>
                
                <!--
                <b:Interaction.Triggers>
                    <b:EventTrigger EventName="RowActivated" >
                        <b:InvokeCommandAction Command="{Binding RowActivatedCommand}" />
                    </b:EventTrigger>
                </b:Interaction.Triggers>
                -->
                
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn
                        SortingState="Ascending"
                        DataMemberBinding="{Binding Start}"
                        Header="{dt:Text Start}" />
                    
                    <telerik:GridViewDataColumn
                        IsSortable="False"
                        DataMemberBinding="{Binding End}"
                        Header="{dt:Text End}" />
                    
                    <telerik:GridViewDataColumn
                        IsSortable="False"
                        DataMemberBinding="{Binding IsActive}"
                        Header="{dt:Text IsActive}" />
                    
                    <telerik:GridViewColumn
                        Header="Delete"
                        IsSortable="False"> 
                        <telerik:GridViewColumn.CellTemplate> 
                            <DataTemplate> 
                                <telerik:RadButton
                                    Content="Delete"
                                    Command="telerik:RadGridViewCommands.Delete"
                                    CommandParameter="{Binding}" /> 
                            </DataTemplate> 
                        </telerik:GridViewColumn.CellTemplate> 
                    </telerik:GridViewColumn> 
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>
        </DockPanel>
        
    </Grid>
</UserControl>

Ola
Top achievements
Rank 1
 asked on 22 Sep 2023
1 answer
71 views

Hello,

I have a ScheduleView that uses only a MonthViewDefinition and implements a ContextMenu for copy/pasting appointments. It works great when using a mouse to right-click and open the context menu.  However, when opening the menu with a 'right-touch', the SelectedSlot property of the ScheduleView is always null.  As a result, the copy/paste only works with touch if the user first touches a slot to 'select' it and then opens the context menu. 

If the user 'right-touches' the day header (GoToDayButton) or an actual appointment, I am able to work around this problem by identifying the selected slot using GetClickedElement<TimeRulerMonthViewItem> or GetClickedElement<AppointmentItem> in the Opening event and programmatically setting the SelectedSlot property.  However, if they are 'right-touching' the empty area in a day slot, I don't see a way to identify the selected day, as GetClickedElement<HighlightItem> returns null.  Is there another way to identify the 'clicked' day in this case, or do you have any other suggestions on dealing with this touch bug?

Thanks in advance,

Vic

Martin Ivanov
Telerik team
 answered on 11 Aug 2023
1 answer
57 views

Hello,

When using the ScheduleView in month view, I find that the visibility of the expand button is fixed to the minimum height of the day slot, i.e., it appears when the number of appointments in a day exceed those that are visible at the minimum height regardless of whether there is still available room (for example, when the window is maximized).  How can this be corrected so that it only appears when there are appointments out of view?

 

Vic
Top achievements
Rank 1
Iron
 answered on 21 Jul 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?