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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Schedule control and mysql

Thread ID:

Created:

Updated:

Platform:

Replies:

127096 Oct 26,2016 03:46 AM UTC Nov 10,2016 01:22 PM UTC Windows Forms 16
loading
Tags: ScheduleControl
mike
Asked On October 26, 2016 03:46 AM UTC

Is it possible to connect the schedule control with my existing mysql database?

And also how to get the data from schedule control to the mysql database without using xml? 

thanks and more power to you guys

Mohanraj Gunasekaran [Syncfusion]
Replied On October 26, 2016 10:17 AM UTC

Hi Mike, 
 
Thanks for using Syncfusion products.  

We have created a sample for adding the SQL data into the Schedule control as per your requirement. In this sample we have populated the ScheduleControl with the sql database. Please refer to the following sample,   

Sample Link: ScheduleControl 

Note: 
To work with the SQL data at your client machine, please modify the connection string by creating a data base using the SQL Express and add the table “ScheduleData” like the attached local db file.  
  
Regards, 
Mohanraj G. 


mike
Replied On October 27, 2016 01:40 AM UTC

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!

mike
Replied On October 27, 2016 02:00 AM UTC

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!

I just found it, it's the WeekMonthItemFormat property... anyway another question, is it possible to change the forecolor of each item, having different textcolors depending on their type? thanks again

mike
Replied On October 27, 2016 05:33 AM UTC

Another question, is it possible to catch the navigation calendar event?  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.  Is it also possible to add a marker on the navigation calendar if there is an event on that day?  Thanks thanks

Mohanraj Gunasekaran [Syncfusion]
Replied On October 27, 2016 12:00 PM UTC

Hi Mike, 

Thanks for your update, 

Please find the responses for your queries 
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;   
 


Sample link: ScheduleGrid 

Note 
Did you ask the customization for Navigation calendar (Right side of the schedule grid)? Please refer the attached screenshot 


Regards, 
Mohanraj G. 


mike
Replied On October 28, 2016 01:30 AM UTC

"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

mike
Replied On October 28, 2016 07:17 AM UTC

"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 already got the recurring appointments by using the "RecurringList"...

The only problem I have is with regards to the side navigation calendar, and also, the snippet you sent me with regards to the textcolor applies to the whole cell.
Is it possible to change the style of the contents/subject only of that cell not including the dates?  And also is it possible to apply text styles only to those cells that have contents/subjects?  Again, thanks for your continued support

mike
Replied On October 28, 2016 08:51 AM UTC

How do I change the metro color theme?  Sorry for the numerous questions...

Adhikesevan Kothandaraman [Syncfusion]
Replied On October 28, 2016 05:17 PM UTC

HI Mike, 

Thanks for your update. 

Please refer to the following response for your queries, 
  
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; 


 



Regards, 
Adhi 


mike
Replied On November 2, 2016 01:58 AM UTC

Great help Sir, thanks a lot.  last question though (hopefully), When I click a date on the side navigation calendar, the main calendar changes view from month to week.  How do I cancel the changing of the ScheduleViewType when I click on the side nav calendar and still get the selected date?  Thanks a lot sir

mike
Replied On November 2, 2016 04:00 AM UTC

Is it also possible to catch the ScheduleViewType event (PerformSwitchToScheduleViewTypeClick) of the schedule control?
Because I noticed that when I change the ScheduleViewType let's say from ScheduleViewType.Week to ScheduleViewType.Month, all the formatting (colors) I made are being reverted back to default.  What I want is to capture the event when changing the scheduleviewtype so I can set the calendar formats after changing the view. again, thank you so much for your help

Piruthiviraj Malaimelraj [Syncfusion]
Replied On November 2, 2016 01:33 PM UTC

Hi Mike, 

Thanks for the update. 

We have analyzed your scenario and created the simple sample. The schedule control does not have direct support to restrict the view changing while selecting the date from calendar. In order to restrict the view changing , SwitchViewStyle property can be used in CalenderGrid.MouseDown and ScheduleContextMenuClick events. The SetupContextMenu event will be triggered whenever the view type is changed. Please make use of the below code, 
 
Code example 
//Form() 
this.scheduleControl1.SwitchViewStyle = false; 
 
this.scheduleControl1.Calendar.CalenderGrid.MouseDown += CalenderGrid_MouseDown; 
this.scheduleControl1.ScheduleContextMenuClick += scheduleControl1_ScheduleContextMenuClick; 
 
void CalenderGrid_MouseDown(object sender, MouseEventArgs e) 
{ 
    this.scheduleControl1.SwitchViewStyle = false; 
} 
void scheduleControl1_ScheduleContextMenuClick(object sender, ScheduleContextMenuClickEventArgs e) 
{ 
    this.scheduleControl1.SwitchViewStyle = true; 
} 
 
//Triggers the event while view type is changing. 
this.scheduleControl1.SetupContextMenu += new CancelEventHandler(scheduleControl1_SetupContextMenu); 
void scheduleControl1_SetupContextMenu(object sender, CancelEventArgs e) 
{ 
    //your code 
} 
 
Sample link 

Regards, 
Piruthiviraj 


mike
Replied On November 8, 2016 08:36 AM UTC

Thanks so much for these it really helped me a lot....
Anyway, probably my last question, how do you wrap the text in a cell?
I have an event in a calendar and the contents are not showing up all and I want it to wrap so all text are visible, if possible, it will fit automatically in the cell.

thanks thanks thanks

Piruthiviraj Malaimelraj [Syncfusion]
Replied On November 9, 2016 01:42 PM UTC

Hi Mike, 

Thanks for the update. 

We have analyzed your scenario. We are little bit unclear with your scenario about which text should be wrapped whether the appointment subject details or other. Could you please provide us with the screen shot of your scenario. It would be more useful for us to provide the exact solution at the earliest. 

Regards, 
Piruthiviraj 


mike
Replied On November 10, 2016 03:07 AM UTC

I want to wrap the appointment subject seen on the calendar (center) area

Please see attached file

Attachment: screen1_b772c1c6.zip

Piruthiviraj Malaimelraj [Syncfusion]
Replied On November 10, 2016 01:22 PM UTC

Hi Mike, 

Thanks for the update. 

We regret to let you know that the schedule control does not have support for wrapped text. As per the current support in schedule control, this is the default behaviour. The appointment subject will be placed within the cell size. The whole string can be viewed by referring the tool tip of that appointment as like below, 

 

Regards, 
Piruthiviraj

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;