This question is locked. New answers and comments are not allowed.
Hello all
I am having trouble getting the Special Slots to visualize when i am grouping. WIthout the grouping they show as expected, but when the reousece grouping is defined it does not show. I even try to add all the resources used for the grouping on all Slots but they still do not show. Any quick pointers?
I am using this to initialize my slot collection:
ObservableCollection<Slot> specialSlots = new ObservableCollection<Slot>();
Providers.SundayOccurence sunday = new Providers.SundayOccurence()
{
Start = StartTime,
End = StartTime.AddDays(1).AddSeconds(-1),
RecurrencePattern = new RecurrencePattern(null, RecurrenceDays.Sunday, RecurrenceFrequency.Weekly, 1, null, null),
};
sunday.Resources.Add(this.ResourceTypes[0]);
foreach (Resource r in this.ResourceTypes[0].Resources)
{
sunday.Resources.Add(new Resource(r.DisplayName, r.ResourceType));
}
specialSlots.Add(sunday);
And this is my Xaml
<telerik:RadScheduleView x:Name="MainSchedule" Grid.Row="2" Margin="2" TimeMarkersSource="{Binding TimeMarkers}"
CategoriesSource="{Binding Categories}" telerik:StyleManager.Theme="Metro" MinAppointmentHeight="10"
NavigationHeaderVisibility="Collapsed" AppointmentsSource="{Binding Appointments}" FirstVisibleTime="00:00:00"
SpecialSlotStyleSelector="{StaticResource SpecialSlotStyleSelector}"
SpecialSlotsSource="{Binding Slots}"
ResourceTypesSource="{Binding ResourceTypes}" IsInlineEditingEnabled="False" SnapAppointments="True"
CurrentDate="{Binding ElementName=TimeBar, Path=SelectionStart}" ToolTipTemplate="{StaticResource AppointmentToolTipTemplate}"
>
<telerik:RadScheduleView.DragDropBehavior>
<providers:ITCalendarDragDropBehaviour />
</telerik:RadScheduleView.DragDropBehavior>
<telerik:RadScheduleView.ActiveViewDefinition >
<telerik:TimelineViewDefinition MinTimeRulerExtent="1" MaxTimeRulerExtent="Infinity"
VisibleDays="{Binding ElementName=TimeBar, Path=Selection, Converter={StaticResource VisibleDaysConverter}}"
StretchAppointments="True" StretchGroupHeaders="True" ShowTimeRuler="True"
TimerulerMajorTickStringFormat="{}{0:%D}"
TimerulerMinorTickStringFormat="{}{0:%D}"
TimerulerGroupStringFormat="{}{0:MM/dd}">
<telerik:TimelineViewDefinition.MajorTickLength>
<telerik:FixedTickLengthProvider TickLength="1.0:0:0" />
</telerik:TimelineViewDefinition.MajorTickLength>
<telerik:TimelineViewDefinition.MinorTickLength>
<telerik:FixedTickLengthProvider TickLength="1.0:0:0"/>
</telerik:TimelineViewDefinition.MinorTickLength>
</telerik:TimelineViewDefinition>
</telerik:RadScheduleView.ActiveViewDefinition>
<telerik:RadScheduleView.AppointmentItemContentTemplate>
<DataTemplate>
<StackPanel Margin="4 2">
<TextBlock Text="{Binding Subject}" FontWeight="Bold" FontSize="9" />
<TextBlock Text="{Binding Appointment.Body}" TextWrapping="Wrap" FontSize="9"/>
</StackPanel>
</DataTemplate>
</telerik:RadScheduleView.AppointmentItemContentTemplate>
<telerik:RadScheduleView.GroupDescriptionsSource>
<telerik:GroupDescriptionCollection>
<telerik:ResourceGroupDescription ResourceType="People" />
</telerik:GroupDescriptionCollection>
</telerik:RadScheduleView.GroupDescriptionsSource>
<telerik:RadScheduleView.GroupHeaderContentTemplate>
<DataTemplate>
<TextBlock Text="{Binding FormattedName}" Width="100" Margin="8 0" VerticalAlignment="Center" />
</DataTemplate>
</telerik:RadScheduleView.GroupHeaderContentTemplate>
<telerik:RadScheduleView.TimeRulerItemStyleSelector>
<providers:GroupItemStyleSelector>
<providers:GroupItemStyleSelector.DefaultStyle>
<Style TargetType="Control">
<Setter Property="Width" Value="1" />
<Setter Property="Height" Value="0" />
</Style>
</providers:GroupItemStyleSelector.DefaultStyle>
<providers:GroupItemStyleSelector.GroupItemStyle>
<Style TargetType="telerik:TimeRulerGroupItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="telerik:TimeRulerGroupItem">
<Border BorderBrush="{StaticResource BasicBrush}" BorderThickness="1 1 0 0">
<ContentPresenter Margin="4 2" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</providers:GroupItemStyleSelector.GroupItemStyle>
<providers:GroupItemStyleSelector.TimeRulerLineStyle>
<Style TargetType="Control">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Control">
<Border BorderBrush="{StaticResource BasicBrush}" BorderThickness="1 0 0 0" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</providers:GroupItemStyleSelector.TimeRulerLineStyle>
</providers:GroupItemStyleSelector>
</telerik:RadScheduleView.TimeRulerItemStyleSelector>
<telerik:RadContextMenu.ContextMenu>
<telerik:RadContextMenu x:Name="contextMenu" IsOpen="{Binding IsContextMenuOpen, Mode=TwoWay}" >
<telerik:RadMenuItem Header="Switch Location" x:Name="rmiSwitchLocation"
Command="{Binding SwitchLocationCommand}"
CommandParameter="{Binding Menu.UIElement.SelectedAppointments, RelativeSource={RelativeSource Self}}"
ItemsSource="{Binding Categories}">
<telerik:RadMenuItem.ItemTemplate>
<DataTemplate >
<StackPanel Orientation="Horizontal">
<Border Background="{Binding Path=CategoryBrush}" Width="16" />
<TextBlock Text="{Binding Path=CategoryName}" Margin="2 0 0 0" />
</StackPanel>
</DataTemplate>
</telerik:RadMenuItem.ItemTemplate>
</telerik:RadMenuItem>
<telerik:RadMenuItem IsSeparator="True" x:Name="rmiSwitchLocationSeparator" />
<telerik:RadMenuItem Header="Create..." x:Name="rmiCreate" ItemsSource="{Binding Categories}">
<telerik:RadMenuItem.ItemTemplate>
<DataTemplate >
<StackPanel Orientation="Horizontal">
<Border Background="{Binding Path=CategoryBrush}" Width="16" />
<TextBlock Text="{Binding Path=CategoryName}" Margin="2 0 0 0" />
</StackPanel>
</DataTemplate>
</telerik:RadMenuItem.ItemTemplate>
</telerik:RadMenuItem>
<!--<telerik:RadMenuItem Header="Create Schedule..." CommandTarget="{Binding Menu.UIElement, RelativeSource={RelativeSource Self}}"
Command="telerik:RadScheduleViewCommands.CreateAppointment" />
<telerik:RadMenuItem Header="Open..." CommandTarget="{Binding Menu.UIElement, RelativeSource={RelativeSource Self}}"
Command="telerik:RadScheduleViewCommands.EditAppointment" />-->
<telerik:RadMenuItem Header="Delete" x:Name="rmiDelete" CommandTarget="{Binding Menu.UIElement, RelativeSource={RelativeSource Self}}"
Command="telerik:RadScheduleViewCommands.DeleteAppointment" />
<!--<telerik:RadMenuItem IsSeparator="True" x:Name="rmiCreateDeleteSeparator" />-->
</telerik:RadContextMenu>
</telerik:RadContextMenu.ContextMenu>
</telerik:RadScheduleView>
I am having trouble getting the Special Slots to visualize when i am grouping. WIthout the grouping they show as expected, but when the reousece grouping is defined it does not show. I even try to add all the resources used for the grouping on all Slots but they still do not show. Any quick pointers?
I am using this to initialize my slot collection:
ObservableCollection<Slot> specialSlots = new ObservableCollection<Slot>();
Providers.SundayOccurence sunday = new Providers.SundayOccurence()
{
Start = StartTime,
End = StartTime.AddDays(1).AddSeconds(-1),
RecurrencePattern = new RecurrencePattern(null, RecurrenceDays.Sunday, RecurrenceFrequency.Weekly, 1, null, null),
};
sunday.Resources.Add(this.ResourceTypes[0]);
foreach (Resource r in this.ResourceTypes[0].Resources)
{
sunday.Resources.Add(new Resource(r.DisplayName, r.ResourceType));
}
specialSlots.Add(sunday);
And this is my Xaml
<telerik:RadScheduleView x:Name="MainSchedule" Grid.Row="2" Margin="2" TimeMarkersSource="{Binding TimeMarkers}"
CategoriesSource="{Binding Categories}" telerik:StyleManager.Theme="Metro" MinAppointmentHeight="10"
NavigationHeaderVisibility="Collapsed" AppointmentsSource="{Binding Appointments}" FirstVisibleTime="00:00:00"
SpecialSlotStyleSelector="{StaticResource SpecialSlotStyleSelector}"
SpecialSlotsSource="{Binding Slots}"
ResourceTypesSource="{Binding ResourceTypes}" IsInlineEditingEnabled="False" SnapAppointments="True"
CurrentDate="{Binding ElementName=TimeBar, Path=SelectionStart}" ToolTipTemplate="{StaticResource AppointmentToolTipTemplate}"
>
<telerik:RadScheduleView.DragDropBehavior>
<providers:ITCalendarDragDropBehaviour />
</telerik:RadScheduleView.DragDropBehavior>
<telerik:RadScheduleView.ActiveViewDefinition >
<telerik:TimelineViewDefinition MinTimeRulerExtent="1" MaxTimeRulerExtent="Infinity"
VisibleDays="{Binding ElementName=TimeBar, Path=Selection, Converter={StaticResource VisibleDaysConverter}}"
StretchAppointments="True" StretchGroupHeaders="True" ShowTimeRuler="True"
TimerulerMajorTickStringFormat="{}{0:%D}"
TimerulerMinorTickStringFormat="{}{0:%D}"
TimerulerGroupStringFormat="{}{0:MM/dd}">
<telerik:TimelineViewDefinition.MajorTickLength>
<telerik:FixedTickLengthProvider TickLength="1.0:0:0" />
</telerik:TimelineViewDefinition.MajorTickLength>
<telerik:TimelineViewDefinition.MinorTickLength>
<telerik:FixedTickLengthProvider TickLength="1.0:0:0"/>
</telerik:TimelineViewDefinition.MinorTickLength>
</telerik:TimelineViewDefinition>
</telerik:RadScheduleView.ActiveViewDefinition>
<telerik:RadScheduleView.AppointmentItemContentTemplate>
<DataTemplate>
<StackPanel Margin="4 2">
<TextBlock Text="{Binding Subject}" FontWeight="Bold" FontSize="9" />
<TextBlock Text="{Binding Appointment.Body}" TextWrapping="Wrap" FontSize="9"/>
</StackPanel>
</DataTemplate>
</telerik:RadScheduleView.AppointmentItemContentTemplate>
<telerik:RadScheduleView.GroupDescriptionsSource>
<telerik:GroupDescriptionCollection>
<telerik:ResourceGroupDescription ResourceType="People" />
</telerik:GroupDescriptionCollection>
</telerik:RadScheduleView.GroupDescriptionsSource>
<telerik:RadScheduleView.GroupHeaderContentTemplate>
<DataTemplate>
<TextBlock Text="{Binding FormattedName}" Width="100" Margin="8 0" VerticalAlignment="Center" />
</DataTemplate>
</telerik:RadScheduleView.GroupHeaderContentTemplate>
<telerik:RadScheduleView.TimeRulerItemStyleSelector>
<providers:GroupItemStyleSelector>
<providers:GroupItemStyleSelector.DefaultStyle>
<Style TargetType="Control">
<Setter Property="Width" Value="1" />
<Setter Property="Height" Value="0" />
</Style>
</providers:GroupItemStyleSelector.DefaultStyle>
<providers:GroupItemStyleSelector.GroupItemStyle>
<Style TargetType="telerik:TimeRulerGroupItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="telerik:TimeRulerGroupItem">
<Border BorderBrush="{StaticResource BasicBrush}" BorderThickness="1 1 0 0">
<ContentPresenter Margin="4 2" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</providers:GroupItemStyleSelector.GroupItemStyle>
<providers:GroupItemStyleSelector.TimeRulerLineStyle>
<Style TargetType="Control">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Control">
<Border BorderBrush="{StaticResource BasicBrush}" BorderThickness="1 0 0 0" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</providers:GroupItemStyleSelector.TimeRulerLineStyle>
</providers:GroupItemStyleSelector>
</telerik:RadScheduleView.TimeRulerItemStyleSelector>
<telerik:RadContextMenu.ContextMenu>
<telerik:RadContextMenu x:Name="contextMenu" IsOpen="{Binding IsContextMenuOpen, Mode=TwoWay}" >
<telerik:RadMenuItem Header="Switch Location" x:Name="rmiSwitchLocation"
Command="{Binding SwitchLocationCommand}"
CommandParameter="{Binding Menu.UIElement.SelectedAppointments, RelativeSource={RelativeSource Self}}"
ItemsSource="{Binding Categories}">
<telerik:RadMenuItem.ItemTemplate>
<DataTemplate >
<StackPanel Orientation="Horizontal">
<Border Background="{Binding Path=CategoryBrush}" Width="16" />
<TextBlock Text="{Binding Path=CategoryName}" Margin="2 0 0 0" />
</StackPanel>
</DataTemplate>
</telerik:RadMenuItem.ItemTemplate>
</telerik:RadMenuItem>
<telerik:RadMenuItem IsSeparator="True" x:Name="rmiSwitchLocationSeparator" />
<telerik:RadMenuItem Header="Create..." x:Name="rmiCreate" ItemsSource="{Binding Categories}">
<telerik:RadMenuItem.ItemTemplate>
<DataTemplate >
<StackPanel Orientation="Horizontal">
<Border Background="{Binding Path=CategoryBrush}" Width="16" />
<TextBlock Text="{Binding Path=CategoryName}" Margin="2 0 0 0" />
</StackPanel>
</DataTemplate>
</telerik:RadMenuItem.ItemTemplate>
</telerik:RadMenuItem>
<!--<telerik:RadMenuItem Header="Create Schedule..." CommandTarget="{Binding Menu.UIElement, RelativeSource={RelativeSource Self}}"
Command="telerik:RadScheduleViewCommands.CreateAppointment" />
<telerik:RadMenuItem Header="Open..." CommandTarget="{Binding Menu.UIElement, RelativeSource={RelativeSource Self}}"
Command="telerik:RadScheduleViewCommands.EditAppointment" />-->
<telerik:RadMenuItem Header="Delete" x:Name="rmiDelete" CommandTarget="{Binding Menu.UIElement, RelativeSource={RelativeSource Self}}"
Command="telerik:RadScheduleViewCommands.DeleteAppointment" />
<!--<telerik:RadMenuItem IsSeparator="True" x:Name="rmiCreateDeleteSeparator" />-->
</telerik:RadContextMenu>
</telerik:RadContextMenu.ContextMenu>
</telerik:RadScheduleView>