Convert datetime schedule to numeric schedule

Hi,

is it possible to change gantt schedule fomr datetime to numeric and viceversa in run time?

Best regards
Gian Piero Truccolo

9 Replies 1 reply marked as answer

SS Sridevi Sivakumar Syncfusion Team April 16, 2021 01:49 PM UTC

Hi Gian Piero Truccolo,

Greetings from Syncfusion.

We have checked the reported query and we can achieve it by changing the CustomScheduleSource as per the below code snippet

 
        private void Button_Click(object sender, RoutedEventArgs e) 
        { 
            List<GanttScheduleRowInfo> RowInfo = new List<GanttScheduleRowInfo>(); 
  
            if (Gantt.ScheduleType == ScheduleType.CustomNumeric) 
            { 
                Gantt.ScheduleType = ScheduleType.CustomDateTime; 
                button.Content = "CustomDateTime"; 
                RowInfo.Add(new GanttScheduleRowInfo() { TimeUnit = TimeUnit.Years, CellsPerUnit = 1 }); 
                RowInfo.Add(new GanttScheduleRowInfo() { TimeUnit = TimeUnit.Months, CellsPerUnit = 3, PixelsPerUnit = 30 }); 
                Gantt.CustomScheduleSource = RowInfo; 
            } 
            else 
            { 
                Gantt.ScheduleType = ScheduleType.CustomNumeric; 
                button.Content = "CustomNumeric"; 
                RowInfo.Add(new GanttScheduleRowInfo() { CellsPerUnit = 5 }); 
                RowInfo.Add(new GanttScheduleRowInfo() { CellsPerUnit = 2, PixelsPerUnit = 30d }); 
                Gantt.CustomScheduleSource = RowInfo; 
  
            } 
        } 

Please have a sample from the below link
https://www.syncfusion.com/downloads/support/directtrac/general/ze/GanttSample1384647837

Let us know if you need any further assistance.

Regards,
Sridevi S.  
 


Marked as answer

GI Gian April 16, 2021 03:08 PM UTC

Hi,

i try your solution but when i add the zoom slider i have this schedule. See the image below


Is there a way to use cusotm numeric scale with an existing zoomslider?
In order to start from one instead of eleven.

Best regards
Gian Piero Truccolo


GI Gian April 19, 2021 07:48 AM UTC

Hi,

i have solved setting the zoom to 100% before changing the schedule type.

Best regards
Gian Piero Truccolo.


SS Sridevi Sivakumar Syncfusion Team April 19, 2021 08:34 AM UTC

Hi Gian Piero Truccolo,

Thanks for your update. 

Let us know if you need any further assistance.

Regards,
Sridevi S. 



GI Gian April 19, 2021 09:13 AM UTC

Hi,

can you make me an example in order to have this kind of schedule when i back to custom datetime?
Because i do not undetsrand how it works.

In attached you will find the videi of the schedule , Week, Day, Hours.

Best regards
Gian Piero Truccolo

Attachment: DateTimeSchedule_c3601b0e.zip


SS Sridevi Sivakumar Syncfusion Team April 20, 2021 11:32 AM UTC

Hi Gian Piero Truccolo,

We have analysed your shared video and we can add a schedule for Weeks, days, and hours as per the below code snippet


[C#]: 
                Gantt.ScheduleType = ScheduleType.CustomDateTime; 
                button.Content = "CustomDateTime"; 
               RowInfo.Add(new GanttScheduleRowInfo() { TimeUnit = TimeUnit.Weeks }); 
                RowInfo.Add(new GanttScheduleRowInfo() { TimeUnit = TimeUnit.Days }); 
                RowInfo.Add(new GanttScheduleRowInfo() { TimeUnit = TimeUnit.Hours,PixelsPerUnit=30 }); 
                 Gantt.CustomScheduleSource = RowInfo; 

Sample link: 
https://www.syncfusion.com/downloads/support/directtrac/general/ze/GanttSample-1935097260

Please check the sample, and revert us if your requirement is different from this?

Let us know if you need any further assistance.

Regards,
Sridevi S. 



GI Gian May 4, 2021 12:48 PM UTC

Hi,

i was trying to hide weekends and holiday with custom numeric schedule and show them if i set custom datetime schedule but the code i have written does not work,

Can you fix the code in order to show me how?

Best Regards
Gian Piero Truccolo

Attachment: HideHolidaysAndWeekends_55d9b4bb.zip


SS Sridevi Sivakumar Syncfusion Team May 6, 2021 11:55 AM UTC

Hi Gian Piero Truccolo,

Query 1: hide weekends and holiday with custom numeric schedule

We would like to inform that, custom numeric schedule does not have weekends/holidays support. So, we have confirmed “Background panel not get refreshed while changing ScheduleType dynamically to Numeric” as an issue. The fix will be included in our upcoming 2021 volume 1 service pack release which is scheduled to be rolled out on 12th May 2021. We appreciate your patience until then.

You can now track the status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.

Feedback link: https://www.syncfusion.com/feedback/25072

Query 2: show them if I set custom datetime schedule but the code i have written does not work

By default Holidays collection is null. So, only it will not get displayed. If we need to show holidays means, we need to add required days in Holidays collection. Please refer the below user guide link for information.

https://help.syncfusion.com/wpf/gantt/holidays-customization

Regards, 
Sridevi S. 



SS Sridevi Sivakumar Syncfusion Team May 13, 2021 01:29 PM UTC

Hi Gian Piero Truccolo,

We have fixed “Background panel not get refreshed while changing ScheduleType dynamically to Numeric” issue and fix is included in our Volume1 SP1 release.
 
 
We are glad to announce that our Essential Studio 2021 Volume 1 Service pack release v19.1.0.63  is rolled out and is available for download under the following link.

Essential Studio 2021 Volume 1 Service Pack Release v19.1.0.63 is available for download | General Discussion Forums | Syncfusion

We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.

Regards,
Sridevi S.
 


Loader.
Up arrow icon