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

Fix Appointment Width

3 Answers 126 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
ALEX
Top achievements
Rank 1
ALEX asked on 25 Sep 2017, 08:18 AM

Hi,

 

I'm using "RadControls for WinForms Q3 2011 SP1" internal build "2011.3.11.1219".I would like to fix appointment width. Our customer created the appointment for one resource. The problem is they do not know exactly schedule time for this resource, so they select one date and time is same (09:00am to 10:00 am). They can't see anything on scheduler when they want to assign the correct date. So i want to set fix width on each appointment. How may i set the width for each appointment.

 

 

3 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 26 Sep 2017, 10:53 AM
Hello, Alex, 

Thank you for writing.  

I would highly recommend you to upgrade to the latest version in order to benefit from all the introduced improvements and new features during the 6 years gap. 

As to the question at hand, note that when you use day view and you have many appointments that share the same timeslot, the appointments will be shrunk to fit the available time slot rectangle. Each appointment must be rendered correctly according to the ruler. For such cases, I would suggest you using SchedulerViewType.Timeline. Thus, appointments for the same interval will be stacked vertically and entirely visible.

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
ALEX
Top achievements
Rank 1
answered on 27 Sep 2017, 08:51 AM

Dear Dess,

 

Thanks you for reply. I know my product is out of date ready and want to upgrade. But ...

 

I added timeline tab at my schedule as per your suggestion. That's pretty good idea. But i have another issue on timeline. My program is crash after switch back timeline to day view or month view. I notice if i set the fixed AppointmentHeight it keep cash. I can't see details if i didn't set hight. :(

void rScheduler_ActiveViewChanged(object sender, SchedulerViewChangedEventArgs e)
{
    if (e.OldView.ViewType != e.NewView.ViewType)
    {
        switch (e.NewView.ViewType)
        {
            case SchedulerViewType.Month:
                rScheduler.GroupType = GroupType.Resource;
                rScheduler.GetMonthView().WeekCount = 5;
                break;
            case SchedulerViewType.Day:
                rScheduler.GroupType = GroupType.Resource;
                rScheduler.GetDayView().DayCount = 1;
                rScheduler.ActiveView.StartDate = DateTime.Today;
                UpdateWorkTime();
                ScrollToWorkTime();
                break;
            case SchedulerViewType.Timeline:
                rScheduler.GroupType = GroupType.None; //i set none. no need to do by group.
                break;
        }
    }
 
    if (e.OldView.ViewType == SchedulerViewType.Month && e.NewView.ViewType == SchedulerViewType.Week)
    {
        _blnIsSwitchedMonthToWeek = true;
    }
    InvalidateScheduler();
}

 

void InvalidateScheduler()
{
    SchedulerDayViewGroupedByResourceElement _SchedulerDayViewGroupedByResourceElement = rScheduler.SchedulerElement.ViewElement as SchedulerDayViewGroupedByResourceElement;
    SchedulerMonthViewGroupedByResourceElement _SchedulerMonthViewGroupedByResourceElement = rScheduler.SchedulerElement.ViewElement as SchedulerMonthViewGroupedByResourceElement;
    TimelineGroupingByResourcesElement _TimelineGroupingByResourcesElement = rScheduler.SchedulerElement.ViewElement as TimelineGroupingByResourcesElement;
    SchedulerTimelineViewElement _SchedulerTimelineViewElement = rScheduler.SchedulerElement.ViewElement as SchedulerTimelineViewElement;
 
    if (_SchedulerDayViewGroupedByResourceElement == null && _SchedulerMonthViewGroupedByResourceElement == null && _TimelineGroupingByResourcesElement == null &&
        _SchedulerTimelineViewElement == null)
        return;
 
    int headerHeight = 50;
    int headerwidth = 150;
 
    if (_SchedulerDayViewGroupedByResourceElement != null)
    {
        _SchedulerDayViewGroupedByResourceElement.ResourceHeaderHeight = headerHeight;
        _SchedulerDayViewGroupedByResourceElement.InvalidateMeasure(true);
    }
    else if (_SchedulerMonthViewGroupedByResourceElement != null)
    {
        _SchedulerMonthViewGroupedByResourceElement.ResourceHeaderHeight = headerHeight;
    }
    else if (_TimelineGroupingByResourcesElement != null)
    {
        _TimelineGroupingByResourcesElement.ResourceHeaderWidth = headerwidth;
    }
    else if (_SchedulerTimelineViewElement != null)
    {
        _SchedulerTimelineViewElement.AppointmentHeight = 100; //set hight keep crach the program
    }
    rScheduler.PerformLayout();
}

 

Otherwise can i set Width and height at time line view?

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 28 Sep 2017, 09:17 AM
Hello, Alex, 

Thank you for writing.  

When in timeline view, you can control only the appointments height. Note that appointments occupy the whole width of the respective time frame and the more time slot columns you have, the less will be the width. You can specify the DisplayedCellsCount of the current timescale. Additional information is available in the following help article: http://docs.telerik.com/devtools/winforms/scheduler/views/timeline-view

Following the provided information, I was unable to reproduce the issue you are facing. Please refer to the attached gif file illustrating the behavior on my end with the specified version. I have attached my sample project. Feel free to modify it in a way to reproduce the experienced issue and get back to me with it so I can investigate the precise case. Thank you in advance. 

I am looking forward to your reply.

Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Scheduler and Reminder
Asked by
ALEX
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
ALEX
Top achievements
Rank 1
Share this question
or