BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
Hi Dwayne,
We can control the start Date and End date while adding a new task and set the date returned from code behind using ActionComplete client side event. Please find the code example for details.
<ej:Gantt ID="Gantt" runat="server" ActionComplete="ActionComplete"> <AddDialogFields> <ej:AddDialogField Field="Id" /> <ej:AddDialogField Field="Name" /> <ej:AddDialogField Field="PercentDont" /> </AddDialogFields> </ej:Gantt> function ActionComplete(args) { var ganttObj = $("#Gantt").data("ejGantt");
if (args.requestType === 'save' && args.addedRecord) { var ganttRecord = args.addedRecord.item; if (args.addedRecord.parentItem) ganttRecord["ParentId"] = args.addedRecord.parentItem.taskId;
$.ajax({ type: "POST", url: "GanttSample.aspx/getDate", contentType: "application/json; charset=utf-8", dataType: "json", success: function (result) { ganttRecord.StartDate = result.d.startdate; ganttRecord.EndDate = result.d.enddate; PageMethods.AddIt(ganttRecord); var obj = $("#Gantt").data("ejGantt"); obj.reRenderChart(); }, failure: function (response) { alert(response.d); } }) } } |
public class date { public string startdate { get; set; } public string enddate { get; set; } }
[WebMethod] public static date getDate() { date gantt = new date(); gantt.startdate = "02/27/2014"; gantt.enddate = "02/29/2014"; return gantt; } |
We have also prepared a sample based on this and you can find the sample under the following location.
Sample: http://www.syncfusion.com/downloads/support/directtrac/general/ze/DateChange245361608
Regards,
Mahalakshmi K.