We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

First day, color appointment and read only

Hello,

I add your schedule control to my own project. I only want to display an planning without that the user have the possibility to modify it. All modification will be done by code.
I read the documentation but I've got some problems :
- how can I block the view in month only. When I double click on a day, the view switch to the day the show details.
- when I add an appointment I can define the color of the brush. That put a small color on the left of the appointment. How can I change the full color of the appointment?
- I want to use the month view but the week always start with Sunday. How can I set Monday as first day of the week ?

Thanks before,

Frédéric 

7 Replies

VR Vigneshkumar Ramasamy Syncfusion Team February 22, 2016 05:30 AM UTC

Hi Frédéric,

Thanks for using Syncfusion product.

As of now we don’t have any property to set FirstDayOfWeek and appointment background in schedule control but it can be achieved in the upgraded SfSchedule control. Please find the below documentation for more details about SfScheduel control and please let us know your interest in SfSchedule control.

UG Link: http://help.syncfusion.com/wpf/sfschedule/overview

1. Switch to day view from month.

As of now it is expected behavior that switch to day view from month when we click events text block in the month view cell.

2. Setting appointment background.

As of now your requirement of setting background to the appointment can be achieved by using AppointmentBackground property of ScheduleAppointment class in the Sfschedule control. Please find the below code snippet for setting AppointmentBackground.

C#

ScheduleAppointment app = new ScheduleAppointment();

            app.Subject = "Meeting";

            app.StartTime = DateTime.Now.AddHours(2);

            app.EndTime = DateTime.Now.AddHours(4);

            app.AppointmentBackground = new SolidColorBrush(Colors.Gray);

            Schedule.Appointments.Add(app);

3. Setting Monday as first day of week.

As of now your requirement of setting Monday as first day of week can be achieved by using the FirstDayOfWeek property in the sfschedule control.

We have prepared a sample for setting appointment background and first day of week and please find the sample in the below link.

Sample Link: SfSchedule_Sample

Please let us know if you have any concern.

Regards

Vigneshkumar R



DF DEPUIS FREDERIC February 22, 2016 05:51 PM UTC

Hello,

Thanks for your reply

Everything works. Only one more think : Is it possible to show more than 2 events for each day in month view ?
Is it possible to change the size or the have a scrollbar on the day if needed ?

Thanks before,

Frédéric


VR Vigneshkumar Ramasamy Syncfusion Team February 23, 2016 05:30 AM UTC

Hi Frédéric

We have created a separate incident for this query, please login to below location to have follow up regarding this query.

Link: https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Please let us know if you have any concern.

Regards

Vigneshkumar R



DF DEPUIS FREDERIC March 6, 2016 09:12 AM UTC

Hello,

Can you tell me where I can change the color of the subject of the appointment (text) ?

Best regards,



VR Vigneshkumar Ramasamy Syncfusion Team March 7, 2016 06:42 AM UTC

Hi Frédéric

As of now your requirement of changing appointment subject foreground can be achieved by using AppiontmentTemplate in the schedule control. We have prepared sample for the same and please find the sample in the below link.

Sample link: SfSchedule_Sample

We have used below code to change appointment subject foreground in the above sample.
C#:


<syncfusion:SfSchedule.AppointmentTemplate>

                <DataTemplate>

                    <Border Background="{Binding AppointmentBackground}">

                        <TextBlock Text="{Binding Subject}" Foreground="Black"></TextBlock>

                    </Border>

                </DataTemplate>

            </syncfusion:SfSchedule.AppointmentTemplate>


Regards

Vigneshkumar R



DF DEPUIS FREDERIC March 8, 2016 08:48 PM UTC

Thanks for your answer.
Is it possible to achieve that by code also ?

Best regards,



VR Vigneshkumar Ramasamy Syncfusion Team March 9, 2016 05:15 AM UTC

Hi Frédéric

As per you requirement we have created a sample to create AppointmentTamplate in code behind for changing the foreground of appointment subject. We can create appointment template in code behind by using FrameworkElementFactory class. Please find the sample in the below link.

Sample Link: SfSchedule_Sample

We have used below code snippet in the above sample to create appointment template in code behind.

C#


DataTemplate AppTemplate = new DataTemplate();

            FrameworkElementFactory grid = new FrameworkElementFactory(typeof(Grid));

            FrameworkElementFactory border = new FrameworkElementFactory(typeof(Border));

            border.SetBinding(Border.BackgroundProperty, new Binding("AppointmentBackground"));

            grid.AppendChild(border);

            FrameworkElementFactory textBlock = new FrameworkElementFactory(typeof(TextBlock));

            textBlock.SetBinding(TextBlock.TextProperty, new Binding("Subject"));

            textBlock.SetValue(TextBlock.ForegroundProperty, new SolidColorBrush(Colors.Yellow));

            grid.AppendChild(textBlock);

            AppTemplate.VisualTree = grid;

            Schedule.AppointmentTemplate = AppTemplate;


Regards

Vigneshkumar R


Loader.
Up arrow icon