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

specify 2 columns in radtimepicker

3 Answers 109 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Swadesh Brojolall
Top achievements
Rank 1
Swadesh Brojolall asked on 27 Apr 2010, 06:15 AM
Hi;
Please help on the issue below.
How can I specify only 2 columns on the radtimepicker.

That is when the timeview loads it is limited to 08:00 to 17:00, with 30 mins interval and there are only 2 columns. One having the hourly values and the other having the half hourly values e.g 08:00 on one side and 08:30 on the other side, next row, 09:00 and 09:30...
Thank you!
swad

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 27 Apr 2010, 09:06 AM
Hi Swadesh,

If you want to configure the RadTimePicker (as described) which is placed on page, then use the settings in order to achieve the same.
ASPX:
 
<telerik:RadTimePicker ID="RadTimePicker1" runat="server" Culture="English (United States)"
    <TimeView CellSpacing="-1" Columns="2" EndTime="17:00:00" Interval="00:30:00" StartTime="05:00:00"
    </TimeView> 
</telerik:RadTimePicker> 


And if you want to change the timepicker appearance in RadScheduler AdvancedForm, then you could access the control from code behind and set the required properties as shown below.
CS:
 
    protected void RadScheduler2_FormCreated(object sender, SchedulerFormCreatedEventArgs e) 
    { 
        if (e.Container.Mode == SchedulerFormMode.AdvancedEdit || e.Container.Mode == SchedulerFormMode.AdvancedInsert) 
        { 
            RadTimePicker startPicker = (RadTimePicker)e.Container.FindControl("StartTime"); // Access the start time timepicker 
            // Configure the TimePicker 
               . . . 
            startPicker.TimeView.StartTime = TimeSpan.FromHours(0); 
            startPicker.TimeView.EndTime = TimeSpan.FromHours(24); 
            startPicker.TimeView.DataList.DataSource = null
            startPicker.TimeView.DataBind(); 
 
 
            RadTimePicker endPicker = (RadTimePicker)e.Container.FindControl("EndTime"); // Access the end time timepicker 
            // Configure the TimePicker 
               . . . 
            endPicker.TimeView.StartTime = TimeSpan.FromHours(0); 
            endPicker.TimeView.EndTime = TimeSpan.FromHours(24); 
            endPicker.TimeView.DataList.DataSource = null
            endPicker.TimeView.DataBind(); 
        } 
    } 



Regards,
Princy.
0
Allen
Top achievements
Rank 1
answered on 14 May 2012, 08:28 PM
Can you show me the code in VB.NET?
0
Princy
Top achievements
Rank 2
answered on 15 May 2012, 05:25 AM
Hello Swadesh,

Here is the code in VB.
VB:
Protected Sub RadScheduler2_FormCreated(sender As Object, e As SchedulerFormCreatedEventArgs)
    If e.Container.Mode = SchedulerFormMode.AdvancedEdit OrElse e.Container.Mode = SchedulerFormMode.AdvancedInsert Then
        Dim startPicker As RadTimePicker = DirectCast(e.Container.FindControl("StartTime"), RadTimePicker)
               startPicker.TimeView.StartTime = TimeSpan.FromHours(0)
        startPicker.TimeView.EndTime = TimeSpan.FromHours(24)
        startPicker.TimeView.DataList.DataSource = Nothing
        startPicker.TimeView.DataBind()
           Dim endPicker As RadTimePicker = DirectCast(e.Container.FindControl("EndTime"), RadTimePicker)
        endPicker.TimeView.StartTime = TimeSpan.FromHours(0)
        endPicker.TimeView.EndTime = TimeSpan.FromHours(24)
        endPicker.TimeView.DataList.DataSource = Nothing
        endPicker.TimeView.DataBind()
    End If
End Sub
Here is converter link.

Thanks,
Princy.
Tags
Scheduler
Asked by
Swadesh Brojolall
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Allen
Top achievements
Rank 1
Share this question
or