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

how can i use dropdownlist to dynamic select time period display on dayview?

3 Answers 143 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Cooper
Top achievements
Rank 1
Cooper asked on 10 Mar 2014, 07:15 AM


Hi! sir:

I have three different time period,like this:


morning : 9:00~12:00

afternoom:13:00~17:00

night: 18:00~23:00

 
May  i  use the dropdownlist  chose the the time   period that i want and dynamic change the RulerStartScale and
dayView.RulerEndtScale  of dayview  (figure 1 show)    ? 

Another problem  is that may i display ,15 minutes. 30minutes.  45 minutes. like figure 2
show    ?
 
thanks a lot!~~


                            customer number:QD1612651

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 11 Mar 2014, 03:28 PM
Hello Cooper,

Thank you for writing.
1. Yes, you can do that with the properties you mentioned. To make it easier, just reset them to their default values prior setting the new range:
void radDropDownList1_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
{
    SchedulerDayView dayView = radScheduler1.GetDayView();
 
    dayView.RulerStartScale = 0;
    dayView.RulerEndScale = 24;
    switch (e.Position)
    {
        case 0:
            dayView.RulerStartScale = 9;
            dayView.RulerEndScale = 12;
            break;
        case 1:
            dayView.RulerStartScale = 13;
            dayView.RulerEndScale = 17;
            break;
        case 2:
            dayView.RulerStartScale = 18;
            dayView.RulerEndScale = 23;
            break;
    }
}


2. You can set the range to be displayed in 15 minutes style, but the numbers (15,30,45) will not be displayed. to change the scale you can use the RangeFactor property:
SchedulerDayView dayView = radScheduler1.GetDayView();
dayView.RangeFactor = ScaleRange.QuarterHour;

More information about this view is available here: http://www.telerik.com/help/winforms/scheduler-views-day-view.html.

I hope this helps. 

Regards,
Stefan
Telerik

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

0
Cooper
Top achievements
Rank 1
answered on 20 Mar 2014, 08:30 AM
Hi sir:

I have another problem with  contextmenu of radscheduler, i want to know the item  which  i selected ,and get text to run my business logic,
like figure1 show.

thank you.......
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 25 Mar 2014, 07:03 AM
Hello Cooper,

Thank you for getting back to me.

In order to detect which item from the context menu is selected, please have a look at the following code snippet:
public Form1()
{
    InitializeComponent();
 
    this.radScheduler1.ContextMenuShowing += radScheduler1_ContextMenuShowing;
}
 
private void radScheduler1_ContextMenuShowing(object sender,
    SchedulerContextMenuShowingEventArgs e)
{
    e.ContextMenu.PopupClosing -= ContextMenu_PopupClosing;
    e.ContextMenu.PopupClosing += ContextMenu_PopupClosing;
}
 
private void ContextMenu_PopupClosing(object sender, RadPopupClosingEventArgs args)
{
    RadDropDownMenu menu = sender as RadDropDownMenu;
    RadItem item = menu.GetSelectedItem();
    if (item != null)
    {
        Console.WriteLine(item.Text);
    }
}

Please do not hesitate to contact us if you have any additional questions.
  
Regards,
Desislava
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
Tags
Scheduler and Reminder
Asked by
Cooper
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Cooper
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or