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

Week view without dates - creating open hours schedule

8 Answers 88 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
GrZeCh
Top achievements
Rank 2
GrZeCh asked on 29 Jun 2008, 01:50 PM
Hello!

Does someone tryted to use RadScheduler for creating "shop open hours" schedule?

There should be only week view without dates where user can mark on what day his shop is open during week (from Monday to Sunday).

Thanks

8 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 30 Jun 2008, 08:50 AM
Hello GrZeCh,

Please, try setting the following properties:

SelectedView="WeekView"
ShowDateHeaders="false"

Is this what you need?


Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
GrZeCh
Top achievements
Rank 2
answered on 30 Jun 2008, 10:24 PM
I used this:
            <telerik:RadScheduler ID="openhoursRadScheduler" runat="server" SelectedView="WeekView" 
                ShowDateHeaders="false" DataStartField="Start" DataEndField="End" DataKeyField="ID" 
                DataSubjectField="Subject" FirstDayOfWeek="Monday" LastDayOfWeek="Sunday" ShowHeader="False" 
                MinutesPerRow="60" ShowFullTime="true"
            </telerik:RadScheduler> 

and now when I create entry on some day and when I try to resize it between hours page postback occurs. When page loads I see my entry only for this time where I placed it at the beggining (entry is not resized). I use latest controls (2008.1.619.35) version.
0
Peter
Telerik team
answered on 01 Jul 2008, 10:39 AM
Hello GrZeCh,

Please, find attached a small test project based on the code you sent. Everything worked as expected on our side. Can you try to modify our project so that you can reproduce the problem and send it back to us for further testing?


Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
GrZeCh
Top achievements
Rank 2
answered on 01 Jul 2008, 08:15 PM
I dont want to use DB for this because in some pages UserID (I use Shop ID) of appointment will be not know so I started to edit this example:

http://www.telerik.com/DEMOS/ASPNET/Prometheus/Scheduler/Examples/BindToList/DefaultCS.aspx

my RadScheduler ASPX:
            <telerik:RadScheduler runat="server" ID="openhoursRadScheduler" SelectedView="WeekView" 
                ShowHeader="false" ShowDateHeaders="false" ShowFooter="false" Width="600px" Skin="Sunset" 
                DayStartTime="00:00:00" DayEndTime="00:00:00" OnAppointmentInsert="openhoursRadScheduler_AppointmentInsert" 
                OnAppointmentUpdate="openhoursRadScheduler_AppointmentUpdate" OnAppointmentDelete="openhoursRadScheduler_AppointmentDelete" 
                DataKeyField="ID" DataSubjectField="Subject" DataStartField="Start" DataEndField="End" 
                DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentId" 
                FirstDayOfWeek="Monday" LastDayOfWeek="Sunday"
            </telerik:RadScheduler> 

my AppointmentInser event:
        protected void openhoursRadScheduler_AppointmentInsert(object sender, SchedulerCancelEventArgs e) 
        { 
            OpenHours.Add(new ClassHours(e.Appointment.Start.DayOfWeek.ToString(),e.Appointment.Start,e.Appointment.End,null,null,0,(int)e.Appointment.Start.DayOfWeek)); 
        } 

I've modified a little AppointmentClass from GenericList example and added new property (int dayofweek). As You can see in Insert Event I'm setting Subject to e.Appointment.Start.DayOfWeek.ToString() and I have question for You. Is there possibility to skip step where user types Subject for Appointment? It should look like user clicks in RadScheduler on some day and after PostBack there is already Appointment crated with e.Appointment.Start.DayOfWeek.ToString() as subject.

0
Dimitar Milushev
Telerik team
answered on 02 Jul 2008, 06:25 AM
Hello,

You can handle the FormCreating event and set the subject of the appointment that's about to be inserted. The event handler should look similar to this:

    protected void RadScheduler1_FormCreating(object sender, SchedulerFormCreatingEventArgs e)
    {
        if(e.Mode == SchedulerFormMode.Insert || e.Mode == SchedulerFormMode.AdvancedInsert)
        {
            e.Appointment.Subject = e.Appointment.Start.ToString();
        }       
    }

Best wishes,
Dimitar Milushev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
GrZeCh
Top achievements
Rank 2
answered on 02 Jul 2008, 06:34 AM
any chance for skipping this step? Or maybe hiding "more" link? Can textfield with subject be set to disabled?
0
Accepted
Peter
Telerik team
answered on 02 Jul 2008, 08:14 AM

You can try using the InlineInsertTemplate. For example:

<InlineInsertTemplate> 
            <asp:TextBox ID="TitleTextBox" runat="server" Enabled="false" Text='<%# Bind("Subject") %>'></asp:TextBox> 
            <asp:LinkButton ID="InsertButton" runat="server" CommandName="Insert">  
                <asp:Image runat="server" ID="insertImage" ImageUrl="Images/ok.gif" AlternateText="insert" /> 
            </asp:LinkButton> 
        </InlineInsertTemplate> 



Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
GrZeCh
Top achievements
Rank 2
answered on 02 Jul 2008, 10:19 AM
Thank You. This is what I was looking for.
Tags
Scheduler
Asked by
GrZeCh
Top achievements
Rank 2
Answers by
Peter
Telerik team
GrZeCh
Top achievements
Rank 2
Dimitar Milushev
Telerik team
Share this question
or