this.scheduleControl1.Calendar.Click += new EventHandler(Calendar_Click);
void Calendar_Click(object sender, EventArgs e)
{
//Write Code
}
scheduleControl1
.DateValueChanged += new DateValueChangedEventHandler(Calendar_ValueChanged);Hi.
I tried both solutions but don´t work for me. Anyone of both events fires. Nothing occurs
Thanks in advance
Raul
//Suggestion1
this.scheduleControl1.Calendar.SelectedDates.SelectionsChanged += SelectedDates_SelectionsChanged;
//Suggestion2
this.scheduleControl1.Calendar.CalenderGrid.CellClick += CalenderGrid_CellClick;
|
//You should attach the Syncfusion.Grid.Windows dll in your project
this.scheduleControl1.GetScheduleHost().ScheduleAppointmentClick += Form1_ScheduleAppointmentClick; |
//You should attach the Syncfusion.Grid.Windows dll in your project
this.scheduleControl1.GetScheduleHost().CellClick += Form1_CellClick; |
Query |
Solution |
I can't make the Click event to work.
First I tried adding the event via code.
ctlSchedule.Calendar.Click += new EventHandler(frmCalendar_Click);
|
Suggestion1
By default, Calendar.Click event does not trigger while clicking on the because we have handled this event internally. So, we would suggest to use the Calendar.CellClick instead of Calendar.Click event. Please refer to the below code example,
Code example
this.scheduleControl1.Calendar.CalenderGrid.CellClick += CalenderGrid_CellClick;
void CalenderGrid_CellClick(object sender, Syncfusion.Windows.Forms.Grid.GridCellClickEventArgs e)
{
//Perform your operation.
}
Note:
This event has not trigger while clicking on the Navigation panel to navigate the date view.
Suggestion2
You can use the Calendar.DateValueChanged event which has triggered when try to navigate the date using NavigationPanel. Please refer to the below code example,
Code example
this.scheduleControl1.Calendar.DateValueChanged += Calendar_DateValueChanged;
void Calendar_DateValueChanged(object sender, EventArgs e)
{
//Perform your operation.
}
|
What attribute do I use to get the start and end date of what is currently displayed by the calendar? For the screenshot above, I want to get Oct 30 and Dec 1. |
In order to get the first and last date of selected calendar, you can use the TopLeftDate and BottomRightDate. Please refer to the below code example and the sample,
Code example
this.scheduleControl1.Calendar.TopLeftDate.ToShortDateString();
this.scheduleControl1.Calendar.BottomRightDate.ToShortDateString();
|