Back to Devexpress

GanttSettings.SettingsTaskList Property

aspnetmvc-devexpress-dot-web-dot-mvc-dot-ganttsettings-94ab7236.md

latest4.8 KB
Original Source

GanttSettings.SettingsTaskList Property

Provides access to the task list settings.

Namespace : DevExpress.Web.Mvc

Assembly : DevExpress.Web.Mvc5.v25.2.dll

NuGet Package : DevExpress.Web.Mvc5

Declaration

csharp
public GanttTaskListSettings SettingsTaskList { get; }
vb
Public ReadOnly Property SettingsTaskList As GanttTaskListSettings

Property Value

TypeDescription
GanttTaskListSettings

Contains task list settings.

|

Remarks

Use the SettingsTaskList property to customize the control’s task list settings.

The Gantt extension stores its columns in the Columns collection. This collection’s methods allow you to add and remove columns.

Run Demo: MVCxGantt - Columns

Available column types:

|

Column Type

|

Description

| | --- | --- | |

GanttCommandColumn

|

A command column.

| |

GanttCheckColumn

|

A column that displays Boolean values.

| |

GanttColorEditColumn

|

A column that displays color values.

| |

GanttDateTimeColumn

|

A data column that displays DateTime values.

| |

GanttProgressBarColumn

|

A column that displays a progress bar.

| |

GanttSpinEditColumn

|

A data column that displays numeric values.

| |

GanttTextColumn

|

A data column that displays text values.

| |

GanttTimeEditColumn

|

A data column that displays time portions of DateTime values.

|

Create a Column

Use the Add method to add a column to the Columns collection. Specify the column’s FieldName property.

csharp
settings.SettingsTaskList.Columns.Add(new GanttTextColumn() { FieldName = "Subject", Caption = "Title", Width = Unit.Pixel(360) });
settings.SettingsTaskList.Columns.Add(new GanttDateTimeColumn() { FieldName = "StartDate", Caption = "Start", Width = Unit.Pixel(100), DisplayFormat = "MM/dd/yyyy" });

Access a Column

Use the Item[Int32] property to access individual columns by their index in the column collection.

csharp
GanttTextColumn colFirstColumn = (GanttTextColumn)settings.SettingsTaskList.Columns[0];

Specify a Column Width

Use the ColumnMinWidth property to specify the minimum width for all columns in the Gantt.

csharp
settings.SettingsTaskList.ColumnMinWidth = Unit.Pixel(45);

To specify the minimum width for an individual column, use the MinWidth property.

csharp
settings.SettingsTaskList.Columns.Add(new GanttTextColumn() { FieldName = "Subject", Caption = "Title", MinWidth = Unit.Pixel(50) });

Column Editor

Each data column type has an editor in edit mode. For example, the GanttCheckColumn column allows you to edit Boolean values in a checkbox editor.

Use the column’s Properties[Editor_Name] property to access column editor settings.

csharp
settings.Columns.Add(c => {
    c.FieldName = "Passengers";
    c.EditorProperties().SpinEdit(p => {
        p.MinValue = 0;
        p.MaxValue = 400;
    });
});

See Also

MVC Gantt - 'How To' Examples

MVC Gantt - Overview

GanttSettings Class

GanttSettings Members

DevExpress.Web.Mvc Namespace