Hello,
I am using RadScheduler with a grouped TimelineView. The number of resources can be selected with a TrackBar, but if the selected value is to high, the view looks squezed and I got overlappings in my customized resource header elements. So my Idea is a minimum ResourceHeaderHeigth. I want to achieve this by calculating the maximum suitable ResourcesPerView value when the Trackbar is changed or the Form / Scheduler is resized. E.g. if my Scheduler has 250 px size, max 5 resources should be visible and if the size is resized to 200 px, only 4 should be shown, so that every resource has at least 50px height.
But to achieve this I need to get the size of the area, where the resources are paintet or SchedulerSize minus Header and Footer.
private void tbVisibleResourceCount_ValueChanged(object sender, EventArgs e)
{
if (DesignMode)
return;
try
{
int val = (int) tbVisibleResourceCount.Value;
if (val <= 0)
{
tbVisibleResourceCount.Value = 1;
}
else
{
var newValue = Math.Min(val, AppointmentsVm?.AktiveRessourcen?.Count ?? 0 /*rsTermine.Resources.Count*/);
/* todo
switch (rsTermine.SchedulerElement.ViewElement)
{
case SchedulerTimelineViewElement timelineElement:
break;
case SchedulerDayViewElement dayViewElement:
break;
case SchedulerMonthViewElement monthViewElement:
break;
case TimelineGroupingByResourcesElement timelineGrouped:
IList<SchedulerTimelineViewElement> childTimelineElements = timelineGrouped.GetChildViewElements();
break;
case SchedulerDayViewGroupedByResourceElement dayViewGrouped:
break;
case SchedulerMonthViewGroupedByResourceElement monthViewGrouped:
break;
}*/
rsTermine.ActiveView.ResourcesPerView = newValue;
}
SetAppointmentsMargin();
_adjustBackgroundsTimer?.Reset();
}
catch (Exception ex)
{
LogHelper.HandleError<CalendarView>(this, $"Fehler in {nameof(tbVisibleResourceCount_ValueChanged)}", ex);
}
}
Hope you can help me with this problem.
Regards,
Stephan