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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Current displayed dates

Thread ID:

Created:

Updated:

Platform:

Replies:

124286 May 30,2016 09:24 AM UTC Jun 16,2016 04:29 AM UTC WinForms 7
loading
Tags: ScheduleControl
Dario Fraschini
Asked On May 30, 2016 09:24 AM UTC

Hello,
there's a way to get the current displayed dates range in schedulecontrol item?

Adhikesevan Kothandaraman [Syncfusion]
Replied On May 31, 2016 02:11 PM UTC

Hi Dario, 

Thanks for using Syncfusion products. 

We have analyzed your reported Query at our end.  We need some more information about your requirement. Can you please let us know the following, 
 
1.       What you are meant by the term “date’s range”? 
2.       Whether you need to get the date displayed in the Navigation Panel or in the SchduleGrid? 


  

Regards, 
Adhi 


Dario Fraschini
Replied On May 31, 2016 02:24 PM UTC

Hello, thanks for your attention.

I need the date range displayed by the Schedule Grid.
My goal is to print the actual view to a report and, to do so, I need the starting date and the ending date being sent to the report parameters.
How can I achive that?

Adhikesevan Kothandaraman [Syncfusion]
Replied On June 1, 2016 05:34 PM UTC

Hi Dario, 

Thanks for your update. 

We have analyzed your scenario at our end. The schedule control does not have the default support to get the start date and end date of the scheduleGrid. If you want to get the date range displayed in the Schedule UI, you can achieve this with some workaround using the AppointmentShowing event. In this event you can get the StartTime of the appointment. Please refer to the following code snippet, 

Code Snippet: 
this.scheduleControl1.ShowingAppointmentForm += new ShowingAppointmentFormHandler(scheduleControl1_ShowingAppointmentForm); 
 
void scheduleControl1_ShowingAppointmentForm(object sender, ShowingAppointFormEventArgs e) 
    DateTime startDate = e.Item.StartTime.Date; 
    //TimeSpan spann = new TimeSpan(); 
    DateTime endDate =startDate.AddDays(34); 
    ///startDate.Add(); 
    MessageBox.Show(e.Item.StartTime.Date.ToString()+"\n"+ endDate.ToString()); 
 
Regards, 
Adhi 


Dario Fraschini
Replied On June 6, 2016 09:45 AM UTC

...and what am I supposed to do with the start date of the appointment?
I need the current displayed schedule date range, so I don't understand what I can do with the starting date of one item....

Is it possible to get at least the scheduler start display date? With this and getting the view mode (month, week, workweek) I can achieve what I need.

Adhikesevan Kothandaraman [Syncfusion]
Replied On June 7, 2016 12:41 PM UTC

Hi Dario, 
  
Thanks for your update. 
  
In our previous update, we have provided the solution for getting the start date value by clicking the appointment cell. You can also use the DrawCellDisplayText event to get the start date of the schedule grid. Using this event, you can get the display text of the particular cell. You can use this text to get the start date of the grid. please make use of the following code snippet and sample, 
  
Code Snippet: 
this.scheduleControl1.GetScheduleHost().DrawCellDisplayText += newSyncfusion.Windows.Forms.Grid.GridDrawCellDisplayTextEventHandler(Form1_DrawCellDisplayText); 
  
string displayText = null; 
void Form1_DrawCellDisplayText(object sender, Syncfusion.Windows.Forms.Grid.GridDrawCellDisplayTextEventArgs e) 
{ 
    if (e.RowIndex == 1 && e.ColIndex == 1) 
        displayText = e.Style.Text; 
} 
  
private void button1_Click(object sender, EventArgs e) 
{ 
    string[] list = displayText.Split(new char[] { '\n' }); 
    //Get the date from the display text 
    DateTime startDate = DateTime.Parse(list[0], this.scheduleControl1.Culture).Date; 
    //Display the start date 
    MessageBox.Show(startDate.ToString()); 
} 
  
Sample: 
 
Regards, 
Adhi 


Dario Fraschini
Replied On June 15, 2016 09:43 AM UTC

I could reach the goal getting the selected dates in the calendar, in this way I know the days displayed on schedulecontrol.

Adhikesevan Kothandaraman [Syncfusion]
Replied On June 16, 2016 04:29 AM UTC

Hi Derek, 

Thanks for your update. 

We are glad to hear that your goal has been reached. Please let us know, if you need any further assistance. 

Regards, 
Adhi 


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

;