Skip to main content

GanttViewSettings.ViewType Property

Specifies a view to display tasks.

Namespace: DevExpress.Web.ASPxGantt

Assembly: DevExpress.Web.ASPxGantt.v24.2.dll

NuGet Package: DevExpress.Web

#Declaration

[DefaultValue(GanttViewType.Days)]
public GanttViewType ViewType { get; set; }

#Property Value

Type Default Description
GanttViewType Days

One of the enumeration values.

Available values:

Name Description
TenMinutes

Displays ten minutes.

Hours

Displays hours.

SixHours

Displays six hours.

Days

Displays days.

Weeks

Displays weeks.

Months

Displays months.

Quarter

Displays quarters.

Years

Displays years.

#Property Paths

You can access this nested property as listed below:

Library Object Type Path to ViewType
ASP.NET MVC Extensions GanttSettings
.SettingsGanttView .ViewType
ASP.NET Web Forms Controls ASPxGantt
.SettingsGanttView .ViewType

#Remarks

Use the ViewType property to specify a view to display tasks: hours, days, weeks, months.

The GanttViewSettings class contains options that specify the gantt control’s view settings. Use the SettingsGanttView property to access these settings.

Run Demo: ASPxGantt - Chart Appearance Run Demo: MVCxGantt - Chart Appearance

Web Forms:

<dx:ASPxGantt ID="Gantt" runat="server" ...>
    //...
    <SettingsGanttView ShowResources="false" TaskTitlePosition="Outside" ViewType="Weeks" />
</dx:ASPxGantt>

MVC:

@Html.DevExpress().Gantt(settings => {
    settings.Name = "gantt";
    settings.SettingsGanttView.ShowResources = false;
    settings.SettingsGanttView.TaskTitlePosition = GanttTaskTitlePosition.Outside;
    settings.SettingsGanttView.ViewType = GanttViewType.Weeks;
    ...
}).Bind(
    GanttDataProvider.Tasks, 
    GanttDataProvider.Dependencies, 
    GanttDataProvider.Resources, 
    GanttDataProvider.ResourceAssignments
).GetHtml()
See Also