Hi, Please suggest me how can we show only working hour in timeline view in rad scheduler and hide non working hour. Currently in timeline view all 24 hour time slot is showing , but I want to show only working hour in time slot and hide rest of non working hour for there. Screen shot for current view and desired view is attached below .
Hello Rohit,
The TimeSlotCreated event allows you to assign a CSS class to the timeslot. Then, with the script below, you can hide these slots and their respective headers:
<telerik:RadScheduler RenderMode="Lightweight" runat="server" ID="RadScheduler1"
Height="600px" SelectedDate="2012-04-16" Font-Size="14px" AccessKey="F" TabIndex="1" SelectedView="TimelineView" GroupBy="User" GroupingDirection="Vertical" RowHeight="50px" OnTimeSlotCreated="RadScheduler1_TimeSlotCreated"
DayStartTime="08:00:00" DayEndTime="23:00:00" OverflowBehavior="Auto">
<TimelineView SlotDuration="01:00:00" NumberOfSlots="40" ColumnHeaderDateFormat="HH:mm" />
<AdvancedForm Modal="true" />
</telerik:RadScheduler>
<script>
function pageLoadHandler() {
$telerik.$(".rsTimelineView .rsContentWrapper .disabled-slot").each(function (ind, item) {
var position = $telerik.$(item).hide().index();
$telerik.$(".rsHorizontalHeaderTable th").eq(position).hide();
})
// Sys.Application.remove_load(pageLoadHandler);
}
Sys.Application.add_load(pageLoadHandler);
</script>
protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
{
if (e.TimeSlot.Start.Hour > 18)
{
e.TimeSlot.CssClass += "disabled-slot";
}
}
With this approach you need to keep in mind 2 things:
Regards,
Peter Milchev
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.