Back to Devexpress

ASPxClientGantt.TaskEditDialogShowing Event

aspnet-js-aspxclientgantt-f1844a0a.md

latest3.7 KB
Original Source

ASPxClientGantt.TaskEditDialogShowing Event

Occurs before the edit dialog is shown.

Declaration

ts
TaskEditDialogShowing: ASPxClientEvent<ASPxClientGanttTaskEditDialogShowingEventHandler<ASPxClientGantt>>

Event Data

The TaskEditDialogShowing event's data class is ASPxClientGanttTaskEditDialogShowingEventArgs. The following properties provide information specific to this event:

PropertyDescription
cancelSpecifies whether to cancel the related action (for example, row edit, export). Inherited from ASPxClientCancelEventArgs.
hiddenFieldsSpecifies hidden fields in the edit dialog.
keySpecifies the task key.
readOnlyFieldsSpecifies read-only fields in the edit dialog.
valuesSpecifies the task values.

Remarks

Run Demo: ASPxGantt - Client-Side Events Run Demo: MVCxGantt - Client-Side Events

Use the TaskEditDialogShowing event to customize the edit dialog before it is invoked.

Web Forms:

aspx
<dx:ASPxGantt ID="Gantt" >
    <ClientSideEvents TaskEditDialogShowing="function(s, e) {
        e.values["Subject"]= "Custom dialog text";
        e.readOnlyFields.push("Subject");
        e.hiddenFields.push("PercentComplete");
    }" />
</dx:ASPxGantt>

MVC:

cshtml
@Html.DevExpress().Gantt(settings => {
    settings.Name = "gantt";
    settings.ClientSideEvents.TaskEditDialogShowing = "function (s, e) { 
        e.values["Subject"]= "Custom dialog text";
        e.readOnlyFields.push("Subject");
        e.hiddenFields.push("PercentComplete");
    }";
    ...
}).Bind(
    GanttDataProvider.Tasks, GanttDataProvider.Dependencies, 
    GanttDataProvider.Resources, GanttDataProvider.ResourceAssignments
).GetHtml()

Result:

Note that the readOnlyFields and hiddenFields event parameters affect only task fields. Use the AllowTaskResourceUpdate property to hide the Resource Manager in the Task Details dialog.

Concepts

See Also

Online Example: How to Implement a Custom "Task Details" Dialog

ASPxGantt - Overview

MVCxGantt - Overview

ASPxGantt - 'How To' Examples

MVCxGantt - 'How To' Examples

ASPxClientGantt Class

ASPxClientGantt Members