Changed Deleted Added Records in Gantt Chart

I know there is another question here asking about CRUD for gantt chart. https://www.syncfusion.com/forums/153238/sample-for-crud

My question is a bit different, I would like to handle the CRUD like this:

public async void ActionComplete(ActionEventArgs<Order> args) 
   if (Args.RequestType == Syncfusion.Blazor.Gantt.Action.Delete) 
        { 
            // You can handle the delete 
             Service.DeletedRec(DeletedRecords[0]);
        } 

The problem is, how are ChangedRecords, DeletedRecords, AddedRecords called in Gantt Chart? I need them because to do CRUD, I have to call the functions in a .cs file, and pass the record to be modified to the functions. For example, the DeletedRec above is going to delete DeletedRecords[0] from the server.

1 Reply 1 reply marked as answer

MS Monisha Sivanthilingam Syncfusion Team November 23, 2021 10:37 AM UTC

Hi Desmond, 
 
Greetings from Syncfusion support. 
 
We can make use of the OnActionComplete event to get the detail of the records that are being edited, added or deleted. The below code snippets demonstrate the solution. 
 
Index.razor 
 
public void OnActionComplete(GanttActionEventArgs<TaskData> args) 
{ 
  if (args.RequestType == Syncfusion.Blazor.Gantt.Action.Save) 
  { 
    if (args.ModifiedRecords[0].Count > 0)  //edited records 
    { 
      var EditedRecords = args.Data; 
    } 
    else //added records 
    { 
      var AddedRecords = args.Data; 
    } 
 
  } 
 
  if (args.RequestType == Syncfusion.Blazor.Gantt.Action.Delete) //deleted records 
  { 
     var DeletedRecords = args.Data; 
  } 
} 
 
 
 
Please contact us if you require any further assistance. 
 
Regards, 
Monisha. 


Marked as answer
Loader.
Up arrow icon