RadScheduleView with GroupDescriptions and ShowAllDayArea

2 posts, 1 answers
  1. Luke
    Luke avatar
    1 posts
    Member since:
    Oct 2012

    Posted 14 Aug 2012 Link to this post

    I have been working on a form with the RadScheduleView and noticed that the AllDayEvent area at the top disappeared at some point in my development. I realised that by adding a ResourceGroupDescription to the GroupDescriptionCollection, the AllDayEvent area disappears even though the ViewDefinition still has the ShowAllDayArea attribute as "True".

    Is this a bug? Is there a way I can group my appointments and still have all day appointments at the top? This is an essential feature for our product.

    Below is simplified code which demonstrates the issue:
    (I wanted to attach a zip with the project but it only allowed me to attach image files)

    <Grid x:Name="LayoutRoot">
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        <Controls:RadButton Content="{Binding ButtonText}" Command="{Binding ToggleCommand}" Height="50" />
        <telerik:RadScheduleView Grid.Row="1"
                AppointmentsSource="{Binding Appointments}"
                ResourceTypesSource="{Binding ResourceTypes}"
                GroupDescriptionsSource="{Binding GroupDescriptions}">
                <telerik:WeekViewDefinition ShowAllDayArea="True" MinTimeRulerExtent="1" />
                <telerik:DayViewDefinition ShowAllDayArea="True" MinTimeRulerExtent="1" />

    public class MainViewModel : ViewModelBase
        private readonly ResourceGroupDescription _resourceGroupDescription;
        private bool _showGroupDescription;
        public MainViewModel()
            ToggleCommand = new RelayCommand(Toggle);
            _resourceGroupDescription = new ResourceGroupDescription {ResourceType = "Staff"};
            GroupDescriptions = new GroupDescriptionCollection {new DateGroupDescription()};
            ResourceTypes = new ObservableCollection<ResourceType> {new ResourceType("Staff") {Resources = {new Resource("John"), new Resource("Mark")}}};
            Appointments = new ObservableCollection<IAppointment>();
            // populate test appointments
            for (var i = -7; i < 7; i++)
                var date = DateTime.Today.AddDays(i).Add(new TimeSpan(9, 30, 0));
                var isAllDay = i%3 == 0;
                var resourceName = i % 2 == 0 ? "John" : "Mark";
                var subject = resourceName + (isAllDay ? " All Day Event" : " Appointment");
                Appointments.Add(new Appointment
                                         Start = date,
                                         End = date.AddHours(8),
                                         Subject = subject,
                                         IsAllDayEvent = isAllDay,
                                         Resources = {new Resource(resourceName, "Staff")}
        public ICommand ToggleCommand { get; private set; }
        public ObservableCollection<IAppointment> Appointments { get; private set; }
        public GroupDescriptionCollection GroupDescriptions { get; private set; }
        public ObservableCollection<ResourceType> ResourceTypes { get; private set; }
        private string _buttonText;
        public string ButtonText
            get { return _buttonText; }
            set { Set(() => ButtonText, ref _buttonText, value); }
        private void Toggle()
            _showGroupDescription = !_showGroupDescription;
            if (_showGroupDescription)
                ButtonText = "Remove Group Description";
                ButtonText = "Show Group Description";

  2. Answer
    Boyan avatar
    758 posts

    Posted 16 Aug 2012 Link to this post

    Hi Luke,

    There is a limitation of the control that you can show all day area only when the DateGroupDescription is the last in GroupDescriptionCollection. So if you want the AllDayArea to be visible you have to change the following code:
    private void Toggle()
        _showGroupDescription = !_showGroupDescription;
        if (_showGroupDescription)
            GroupDescriptions.Insert(0, _resourceGroupDescription);

    Hope this helps.

    All the best,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top