Change existing cell schdule content

Hi,

is there the possibility to change the cell schedule content after loading with a button click command?

Best regards
Gian Piero Truccolo

3 Replies 1 reply marked as answer

RS Ramya Soundar Rajan Syncfusion Team June 8, 2021 10:32 AM UTC

Hi Gian Piero Truccolo, 
  
Greetings from Syncfusion. 
 
As we have told in previous forum (https://www.syncfusion.com/forums/165769/custom-schedule), we can change the schedule cell’s content through ScheduleCellCreated event only. We don’t have any options to change the schedule cell’s content once it gets loaded. 
 
Regards, 
Ramya S. 



GI Gian June 17, 2021 12:12 PM UTC

Hi,

do you think you could implement this option in the next future?

Best regards
Gian Piero Truccolo




SS Sridevi Sivakumar Syncfusion Team June 18, 2021 02:31 PM UTC

Hi Gian Piero Truccolo,

We would like to inform you that, in our current implementation we are re-generating the GanttScheduleCells on loading and as well scrolling horizontally. So, it is not possible to implement your requirement as a feature. Instead, you can achieve your requirement at the sample level by re-generate the schedule dynamically through adjusting the GanttSchedule’s StartTime forth and back, at that time the schedule cells will be re-generated and the ScheduleCellCreatedEvent will be called, in it you can change the cell content as below.
 
  
 
public partial class MainWindow : Window 
{ 
    /// <summary> 
    /// To avoid changing the cell content on loading. 
    /// </summary> 
    private bool canChangeText; 
  
    public MainWindow() 
    { 
        InitializeComponent(); 
    } 
  
    private void Gantt_ScheduleCellCreated(object sender, ScheduleCellCreatedEventArgs args) 
    { 
        if (this.canChangeText) 
        { 
            if (args.CurrentCell.CellTimeUnit == TimeUnit.Days 
                && args.CurrentCell.CellDate.DayOfWeek == System.DayOfWeek.Monday) 
            { 
                args.CurrentCell.Content = "Mon"; 
            } 
        } 
    } 
  
    private void ChangeContent_Click(object sender, RoutedEventArgs e) 
    { 
        this.canChangeText = true; 
        this.Gantt.StartTime = this.Gantt.ActualStartTime.AddDays(1); 
        this.Gantt.StartTime = this.Gantt.ActualStartTime.AddDays(-1); 
    } 
} 
 
  
Please get the sample from the below link
https://www.syncfusion.com/downloads/support/directtrac/general/ze/CustomSchedule774331801

Please let us know if you have any concerns.

Regards,
Sridevi S.
 
 


Marked as answer
Loader.
Up arrow icon