ScheduleControl

hi,
I'm working with the ScheduleControl in winforms.

I want to obtain the time and Date of the CurrentCell of ScheduleGrid.

I got Time with GetTimeDisplayText(row) but not the date.
Regards,

internal class oiScheduleGrid : ScheduleGrid
    {
        public oiScheduleGrid(NavigationCalendar calendar, ScheduleControl schedule, DateTime theDate)
            : base(calendar, schedule, theDate)
        {

        }

        public string TimeOfRow ( int rowindex)
        {
            string value = base.GetTimeDisplayText(rowindex);
            return value;
        }
        public DateTime DateOfCol( int colindex )
     {
          //?????
     }
    }




can you help me?

3 Replies 1 reply marked as answer

BT Balamurugan Thirumalaikumar Syncfusion Team March 5, 2021 08:33 AM UTC

Hi Florian, 
 
Thank you for using Syncfusion products. 
 
We have checked your reported query “I want to obtain the time and Date of the CurrentCell of ScheduleGrid” at our end. You can achieve your requirement by accessing the currentcell value by using the ClickDateTime method by passing the currentcell row index and column index of the ScheduleGrid. You can refer the following code snippet. 
 
Code Snippet(C#) 
//Event customization 
this.scheduleControl1.ScheduleAppointmentClick += ScheduleControl1_ScheduleAppointmentClick; 
 
//Event customization 
private void ScheduleControl1_ScheduleAppointmentClick(object sender, ScheduleAppointmentClickEventArgs e) 
        { 
            MethodInfo dynMethod = scheduleControl1.GetScheduleHost().GetType().GetMethod("ClickDateTime", 
            BindingFlags.NonPublic | BindingFlags.Instance, null, new Type[] { typeof(int), typeof(int) }, null); 
 
            var arguments = new object[] { this.scheduleControl1.GetScheduleHost().CurrentCell.RowIndex, 
            this.scheduleControl1.GetScheduleHost().CurrentCell.ColIndex }; 
            var seldate = dynMethod.Invoke(scheduleControl1.GetScheduleHost(), arguments); 
 
            MessageBox.Show(seldate.ToString()); 
        } 
 
Please let us know if you would require any other assistance. 
 
Regards 
Balamurugan.Thirumalaikumar

Marked as answer

DS Dev Staff March 5, 2021 10:53 AM UTC

Hi,
Thanks for your answer it's ok I can get the date.

An other question :
In CustomWeek, the Caption button seems to be hidden event i do
as https://www.syncfusion.com/forums/131769/how-do-we-implement-custom-view-type-in-schedule-control

this.scheduleControl1.ScheduleType = ScheduleViewType.CustomWeek;
this.scheduleControl1.CaptionPanel.Visible = true;
this.scheduleControl1.Appearance.ShowCaption = true;
this.scheduleControl1.Appearance.ShowCaptionButtons = true;

regards,






BT Balamurugan Thirumalaikumar Syncfusion Team March 8, 2021 02:30 PM UTC

Hi Florian, 
 
Thank you for the update. 
 
We have checked your query “In CustomWeek, the Caption button seems to be hidden event” at our end. We have tried to replicate the reported scenario, it working as expected. CaptionButton visible only for all the OfficeThemes(VisualStyles). You can refer the below sample for your reference. 
 
 
Output screenshot(With CaptionButton) 
 
If we misunderstood your query, please modify the attached sample to reproduce your issue or please attach the screenshot of your query. 
 
Regards, 
Balamurugan Thirumalaikumar  
 


Loader.
Up arrow icon