suggested interval for an appointment is wrong

I tried to open a new appointment based on a single "cell" click with context menu but the suggested Date (day) is the first day of week interval, not the day I selected. If I select a larger period of time (multiple cells) then the suggested date is correct. How can I solve this problem, to read the correct date (day) from selection?

Attachments contains an example from samples that come with components.

Thanks

Attachment: err_ccf1ba0a.zip

Later edit: I found a solution but not very elegant one

        Dim ColumnIndex As Integer = sc1.GetScheduleHost().CurrentCell.ColIndex
        Dim dataStart As String = sc1.GetScheduleHost().Model(0, ColumnIndex).CellValue

The problem is dataStart As String (or Object in original version) because return any format but Date format. I used string manipulation to create date from string but I am worried if this solution will work in different conditions/environments. If you have a better approach please let me know.

Thanks

1 Reply

AR Arulpriya Ramalingam Syncfusion Team January 2, 2018 12:00 PM UTC

Hi Constantin,   
   
Thanks for contacting Syncfusion support.   
   
As per the current support of ScheduleControl, the Start and End date values will be updated in the item when the MouseUp of CellDoubleClick is occurred. As per your scenario, you have showed the AppointmentForm on single click and the item values will not be updated in the Appointment form. You can retrieve the start and end date by retrieving the cell value as per your code part using the CellValue property of GetScheduleHost() method and typecast to perform the actions based on the conditions. As per your scenario, your code part could be the feasible solution. Moreover, you can also use the GetViewStyleInfo() to retrieve the cell value of current cell. Please refer to the below code,   
   
Code example   
   
//To retrieve the cell value when appointment is showing    
Dim dataStart As String =this.scheduleControl1.GetScheduleHost().GetViewStyleInfo(rowIndex, colIndex).CellValue   
   
Please let us know if you have any other queries.   
   
Regards,   
Arulpriya 


Loader.
Up arrow icon