SfGantt - dynamical GanttEventMarkers

Hi there,

is it possible not to hardcode a date of an an event marker, but to dynamically bind it to a task?
So if the end date of the bound task gets changed, the event marker changes it's date, too?

Thank you for your help.

Cheers,
Volker

1 Reply

LG Logeswari Gopalakrishnan Syncfusion Team June 1, 2020 02:13 PM UTC

Hi Volker, 
In our Gantt, EventMarkers is set for whole project. We have update the eventmarkers while end date is changed using EndEdit event. Please find the below code snippet. 
 
<SfGantt @ref="Gantt" DataSource="@TaskCollection" Height="450px" Width="700px"> 
    <GanttEventMarkers> 
        <GanttEventMarker Day="@Day" Label="Marker1" 
                          CssClass="e-custom-event-marker"></GanttEventMarker> 
 
    </GanttEventMarkers> 
 
    <GanttEvents EndEdit="endEdit" TValue="TaskData"></GanttEvents> 
</SfGantt> 
../// 
 
public void endEdit(ITaskbarEditedEventArgs<TaskData> 
    args) 
    { 
    if (args.Action == "CellEditing" ) 
    { 
    if (args.Data.Index == 2) 
    { 
    Day = (args.Data.GanttProperties.EndDate.Value.AddDays(1).ToString("M-dd-yyyy")); 
    } 
    } 
    } 
 
 
Please find the below sample link. 
 
If not matched your requirement, please give detailed requirement with event markers along with task in Gantt.  
 
Regards, 
Logeswari G 


Loader.
Up arrow icon