Many thanks for this!!!I have additional question though, how do I change the format of the text shown in the calendar, month view?Let's say, the item is "Birthday 10:00", I just want it to display the "Birthday" without the time. Is it possible?Again thank you very much for your help!
is it possible to change the forecolor of each item, having different textcolors depending on their type? |
You can achieve your requirement using TextColor property in ScheduleGrid.QueryCellInfo event. Please refer the below code snippet and refer the below attached sample,
Code snippet
this.scheduleControl1.GetScheduleHost().QueryCellInfo += Form1_QueryCellInfo;
ScheduleViewType type;
void Form1_QueryCellInfo(object sender, Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventArgs e)
{
type = this.scheduleControl1.ScheduleType;
if (type == ScheduleViewType.Month && e.ColIndex % 2 == 0 && e.RowIndex > 0)
e.Style.TextColor = Color.Red;
}
|
I'm using a customized context menu and I want to add an Item if right clicked a date on the navigation calendar. the problem is I don't know how to get the selected date/item on the navigation calendar |
In order to get the selected item, you can use the ScheduleGrid.SelectedAppointments property. Please refer the below KB link,
KB link
Get the selected appointments
Add the new appoointments
|
Is it also possible to add a marker on the navigation calendar if there is an event on that day? |
The marker support available only for metro theme. So if you want marker for appointments, please use the Metro theme for ScheduleControl. Please refer the below code snippet,
Code snippet
scheduleControl1.Appearance.VisualStyle = Syncfusion.Windows.Forms.GridVisualStyles.Metro;
|
"Did you ask the customization for Navigation calendar (Right side of the schedule grid)? Please refer the attached screenshot "Yup, I'm referring to the navigation calendar on the sides. I can already get the selected date on the (appointment?) calendar using ScheduleAppointmentClick but what I need is the one from the navigation calendar (calendar on the sides).By the way, thanks for the awesome help on the other items...Also, is it possible to add recurring appointments programatically? thanks
I can already get the selected date on the (appointment?) calendar using ScheduleAppointmentClick but what I need is the one from the navigation calendar (calendar on the sides).
|
If you want to get the selected date from the navigation panel, you can use the CalenderGrid.CellClick event as of follows,
Code snippet:
this.scheduleControl1.Calendar.CalenderGrid.CellClick += CalenderGrid_CellClick;
void CalenderGrid_CellClick(object sender, Syncfusion.Windows.Forms.Grid.GridCellClickEventArgs e)
{
//Display the selected date in the navigation panel
MessageBox.Show(this.scheduleControl1.Calendar.CalenderGrid[e.RowIndex, e.ColIndex].Text.ToString());
}
|
Is it possible to change the style of the contents/subject only of that cell not including the dates?
|
If you want to change the style navigation panel dates that has an appointment, refer to the following Kb document,
|
is it possible to add recurring appointments programatically? |
To add the multi span day appointment in a schedule control, you can use the AddSpanAppointment method. Please refer to the following code snippet to add the multi span day appointment in schedule control,
Code Snippet:
ArrayListDataProvider dataprovider = new Syncfusion.Schedule.ArrayListDataProvider();
IScheduleAppointment appointment = dataprovider.NewScheduleAppointment();
appointment = dataprovider.NewScheduleAppointment();
appointment.StartTime = DateTime.Now;
appointment.EndTime = DateTime.Now.AddDays(4);
appointment.AllDay = true;
appointment.Subject = "Leave";
appointment.LabelValue = 1;
appointment.AllowResize = false;
appointment.AllowDrag = false;
//Convert the appointment as the recurrence schedule appointment
IRecurringScheduleAppointment recurrenceAppointment = appointment as IRecurringScheduleAppointment;
//Add the multi-span day appointment to the schedule control
this.scheduleControl1.AddSpanAppointment(recurrenceAppointment, dataprovider);
this.scheduleControl1.DataSource = dataprovider;
|
How do I change the metro color theme? |
If you want to change the colors of the metro theme, you can use the Appearance properties of the schedule control,
code snippet:
// Setting metro theme for schedule control
this.scheduleControl1.Appearance.VisualStyle = Syncfusion.Windows.Forms.GridVisualStyles.Metro;
// Customize the appearance of navigation calendar
this.scheduleControl1.Appearance.NavigationCalendarWeekNumberColor = Color.Green;
this.scheduleControl1.Appearance.NavigationCalendarTextColor = Color.Red;
|