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

EndDate by default is the next day after selected.. any way to have selected date?

13 Answers 153 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Maria
Top achievements
Rank 1
Maria asked on 14 Oct 2008, 02:18 PM
Hello Telerik,

By default EndDate is one day after the selected day,
I was wondering if it can be the same date?

Thank you.

13 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 15 Oct 2008, 10:38 AM
Hello Maria,

Could you please elaborate on what exactly you need to achieve?

I suggest you review this kb article, the "Highlight the current day" variations in particular, and see if it helps.


Best wishes,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Maria
Top achievements
Rank 1
answered on 15 Oct 2008, 12:28 PM

Hello Telerik,

When you are in advanced edit/insert, 

there are 1 textbox for the subject and 2 datetimepickers for start date/time and end date/time of the event. 

Each time, I'm going to advanced insert mode, start datetime picker shows the selected date + 12: 00  AM, and the other one, 'end' datetimepicker shows the next day to the selected one + 12:00 AM. I want the second one, 'end' timepicker also to show the selected date.

The other issue would be to change from 12:00 AM to smth more realistic. I have already limited the possible time from 8am to 8 pm, so a user cannot pick smth else, however, those to controls show 12:00 AM by default.

Thank you.

0
Peter
Telerik team
answered on 15 Oct 2008, 01:21 PM
Hi Maria,

Please, see the kb articl on How to access controls in the advanced form. Should you have further questions, feel free to let us know.


Regards,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Maria
Top achievements
Rank 1
answered on 15 Oct 2008, 01:27 PM
Dear Telerik,

I know how to access those controls from 

RadScheduler1_FormCreated for instance. Do you really suggest me finding the control and changing the date? On which event? However, those two datetimepickers are bound to end and start. And I don't want to override the user's selection.

Thank you.

0
Peter
Telerik team
answered on 15 Oct 2008, 02:18 PM

Sorry, I might be missing something. Could you please explain in greater detail what exactly you want ot achieve? If you need to send us screenshots or other files which will help us get a better understanding of what you are after, you can open a support ticket and attach files there.



Kind regards,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Maria
Top achievements
Rank 1
answered on 15 Oct 2008, 05:02 PM

"If you need to send us screenshots or other files "
How can I insert an image into my response? 


Please, go to any of your demos, for instance,
http://demos.telerik.com/aspnet/prometheus/Scheduler/Examples/RadToolTip/DefaultCS.aspx

1.) click on a date in order to create a new event (from month view)
let's take 2/27/2007
2.) click on "more" in order to get to the advanced view
3.)
then you will see 2 controls with dates
start: 2/27/2007 and 
end:  2/28/2007

How can I make he second date to be the selected date (2/27/2007) instead of
the next date?



0
Peter
Telerik team
answered on 16 Oct 2008, 10:00 AM
Hi Maria,
                
If you want to send us files, you need to open a support ticket. 

However, this is not necessary since I understood your point. The behavior which you describe is expected, since when you insert an appointment in month view, it is created as an all day appointment, and the end date has to be the next day. 

You can override this default behavior by attaching onto the FormCreated event and finding the datepickers as in the kb article I suggested. 
                                
                

Greetings,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Maria
Top achievements
Rank 1
answered on 16 Oct 2008, 12:59 PM
Hi Peter,

How do you suggest differentiate between "first time" when a user got to that form and when smth is changed?
I'm just afraid to override user's selection setting end date the same as start date every time.
(!this.IsPostBack) will not probably work, will it?

Thank you.
0
Peter
Telerik team
answered on 16 Oct 2008, 01:08 PM
Hello Maria,

I understand your concern. However, you can easily differentiate for Month view using the SectedView property:

protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e)  
    {  
        if ((RadScheduler1.SelectedView == SchedulerViewType.MonthView) & ((e.Container.Mode == SchedulerFormMode.AdvancedInsert) || (e.Container.Mode == SchedulerFormMode.AdvancedEdit)))  
        {  
            //My custom code here.   
        }  
    } 



Regards,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Maria
Top achievements
Rank 1
answered on 16 Oct 2008, 01:21 PM
Hi Peter,

You probably didn't understand me.
I don't care, whether it's a view month/day/week or whatever.
What I care is, if I set End Date to be the same date as Start Date,
and then a user changes it to a new date, I don't want to override a user's selection on the next PostBack by setting End Date to be the same as Start Date again.

I know, you guys, are Bulgarians, if you don't understand me, my co-worker speaks Bulgarian, I can ask him to explain it in your language. Let me know, if it will help.

Thank you.
0
Peter
Telerik team
answered on 16 Oct 2008, 02:54 PM


Greetings to your Bulgarian co-worker, Maria. I will be happy to hava a chat with him or her, but I don't think the English language poses any kind of communcation barrier.

I suggest you try the following code, which sets default time for the inserted appointment in Month view from noon to 1 pm. Note, that I exclude the EditMode case. Please, test extensively your application with this code and let us know if you experiecne any problems with it.

protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e)  
    {  
        if ((RadScheduler1.SelectedView == SchedulerViewType.MonthView) & (e.Container.Mode == SchedulerFormMode.AdvancedInsert))  
        {  
            RadDateInput endTimeTimeInput = (RadDateInput)e.Container.FindControl("EndTime");  
            RadDatePicker endTimeDatePicker = (RadDatePicker)e.Container.FindControl("EndDate");  
            RadDateInput startTimeTimeInput = (RadDateInput)e.Container.FindControl("StartTime");  
            //RadDatePicker startTimeDatePicker = (RadDatePicker)e.Container.FindControl("StartDate");  
            CheckBox allDayCheckBox = (CheckBox)e.Container.FindControl("AllDayEvent");  
            allDayCheckBox.Checked = false;  
            startTimeTimeInput.SelectedDate = e.Appointment.Start.AddHours(12);  
            endTimeTimeInput.SelectedDate = e.Appointment.Start.AddHours(13);              
            endTimeDatePicker.SelectedDate = e.Appointment.Start;  
        }  
    } 



All the best,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
J
Top achievements
Rank 1
answered on 16 Oct 2008, 10:00 PM
I'm having a similar issue as well... the kb articles referenced aren't answering it for me...

On the calendar itself in month view, if I load the start and endDate properties of the Appointment object which binds to the calendar, it shows the appointment overlapping into the next day..

This occurs even when the start and end date are both the same exact day/time.  ex. "10/16/2008 5:00 PM" for appt.Start and appt.End

any ideas?
0
Peter
Telerik team
answered on 17 Oct 2008, 10:53 AM
Hi J,

The code sample in my previous post works as expected. Did you use this approach as well? If the problem persists, I suggest you open a support ticket and send us a sample project.


Greetings,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Scheduler
Asked by
Maria
Top achievements
Rank 1
Answers by
Peter
Telerik team
Maria
Top achievements
Rank 1
J
Top achievements
Rank 1
Share this question
or