Query |
Response | ||
I want to get the date value year, month, and day of the scheduler navigation panel. (Red box in picture of attachment) |
To get the selected date value, you could use the ControlText property. Please refer the following code example.
| ||
I want to know how to parse full date time value (yyyy-mm-dd), not parse (mm-dd) |
To get the date value with year, you could parse the date with the date format. Please refer the following code example.
|
this.scheduleControl1.GetScheduleHost().DrawCell += Form1_DrawCell;
private void Form1_DrawCell(object sender, Syncfusion.Windows.Forms.Grid.GridDrawCellEventArgs e)
{
if (e.RowIndex == 1 && e.ColIndex == 1)
{
displayText = e.Style.Text;
String date = displayText.Substring(0, displayText.IndexOf('\n'));
DateTime dateTime;
if (DateTime.TryParse(date, out dateTime))
{
DateTime dateValue = newDateTime(this.scheduleControl1.Calendar.DateValue.Year, dateTime.Month, dateTime.Day);
e.Style.Text = dateValue.ToShortDateString();
}
}
} |