GanttSettings.ClientLayout Property
Enables you to save and restore the previously saved Gantt’s layout.
Namespace: DevExpress.Web.Mvc
Assembly: DevExpress.Web.Mvc5.v19.1.dll
Declaration
Property Value
Type | Description |
---|---|
ASPxClientLayoutHandler | A method to which the Gantt delegates custom processing. |
Remarks
Handle the ClientLayout event to save and restore the Gantt’s layout from a data store.
Save Layout
The event parameter’s LayoutMode property returns Saving. The LayoutData property contains the Gantt’s current layout that should be saved, for example, to a database.
Restore Layout
The LayoutMode property returns Loading. Read the Gantt’s layout data from a data store and assign it to the LayoutData property. You can also save and restore the Gantt’s layout using the MVCxGantt.SaveClientLayout and MVCxGantt.LoadClientLayout methods.
Example
@Html.DevExpress().Gantt(settings => {
...
settings.ClientLayout += (s, e) => {
if (e.LayoutMode == DevExpress.Web.ClientLayoutMode.Saving) {
SaveUserLayoutToDatabase(testID, "TestGanttAccount", e.LayoutData);
}
else {
if (System.IO.File.Exists(fileName))
e.LayoutData = RestoreUserLayoutFromDatabase(testID, "TestGanttAccount");
}
};
...
}).Bind(GanttDataProvider.Tasks, GanttDataProvider.Dependencies, GanttDataProvider.Resources, GanttDataProvider.ResourceAssignments).GetHtml()
See Also