4 Answers, 1 is accepted
0
Hi samin,
I suggest you set CurrentDate property of the RadScheduleView control - in MonthView mode the corresponding Month will be displayed. Also VisibleDays property of the MonthViewDefinition can be used to show more than one month:
Hope this helps.
Kind regards,
Yana
the Telerik team
I suggest you set CurrentDate property of the RadScheduleView control - in MonthView mode the corresponding Month will be displayed. Also VisibleDays property of the MonthViewDefinition can be used to show more than one month:
<
telerik:RadScheduleView.ViewDefinitions
>
<
telerik:MonthViewDefinition
VisibleDays
=
"50"
/>
</
telerik:RadScheduleView.ViewDefinitions
>
Hope this helps.
Kind regards,
Yana
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Håkan
Top achievements
Rank 1
answered on 12 Oct 2011, 12:34 PM
Hi,
In the MonthView I want to set current week as the first week in the view, then I want to display six weeks.
This is because we use the calendar as a scheduling tool, and we are not interested in passed days.
But setting the CurrentDate always display the whole month, is there anyway to explicitly set the first date?
- Regards,
Håkan
In the MonthView I want to set current week as the first week in the view, then I want to display six weeks.
This is because we use the calendar as a scheduling tool, and we are not interested in passed days.
But setting the CurrentDate always display the whole month, is there anyway to explicitly set the first date?
- Regards,
Håkan
0
Hello Håkan,
You need to create a new ViewDefinition, that derives from MonthViewDefinition and override its GetVisibleRangeStart method. For example the following view definition will display MonthView that starts from the first day of the week that contains the current date:
public class CustomMonthViewDefinition : MonthViewDefinition
{
protected override DateTime GetVisibleRangeStart(DateTime currentDate, CultureInfo culture, DayOfWeek? firstDayOfWeek)
{
return CalendarHelper.GetFirstDayOfWeek(currentDate, firstDayOfWeek.Value);
}
}
Then you could use it like this:
<telerik:RadScheduleView>
<telerik:RadScheduleView.ViewDefinitions>
<local:CustomMonthViewDefinition VisibleDays="42" />
</telerik:RadScheduleView.ViewDefinitions>
</telerik:RadScheduleView>
where 42 comes from the range you requested - 6 weeks * 7 days = 42 days.
Regards,
Valeri Hristov
the Telerik team
You need to create a new ViewDefinition, that derives from MonthViewDefinition and override its GetVisibleRangeStart method. For example the following view definition will display MonthView that starts from the first day of the week that contains the current date:
public class CustomMonthViewDefinition : MonthViewDefinition
{
protected override DateTime GetVisibleRangeStart(DateTime currentDate, CultureInfo culture, DayOfWeek? firstDayOfWeek)
{
return CalendarHelper.GetFirstDayOfWeek(currentDate, firstDayOfWeek.Value);
}
}
Then you could use it like this:
<telerik:RadScheduleView>
<telerik:RadScheduleView.ViewDefinitions>
<local:CustomMonthViewDefinition VisibleDays="42" />
</telerik:RadScheduleView.ViewDefinitions>
</telerik:RadScheduleView>
where 42 comes from the range you requested - 6 weeks * 7 days = 42 days.
Regards,
Valeri Hristov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Håkan
Top achievements
Rank 1
answered on 13 Oct 2011, 10:22 AM
That worked fine, thank you!
Regards,
Håkan
Regards,
Håkan