Skip to main content
Version: 4.2

GanttView

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.2.0.0)

Displays a project task hierarchy with editable dates, completion, dependencies and a working calendar.

public class GanttView : Control

Dates use calendar dates rather than time zones. End is exclusive. Dragging preserves working-day duration; resizing changes scope. Predecessors constrain start dates. Pointer movement stays local; TaskMoving is raised at drop, followed by a completion event only when accepted. Bound records must expose writable mapped properties for edits. Summary rows do not aggregate dates automatically.

Example:

var gantt = new GanttView { Dock = DockStyle.Fill, AllowDrag = true, AllowResize = true };
gantt.Tasks.Add(new GanttTask { Id = "design", Text = "Design", Start = DateTime.Today, End = DateTime.Today.AddDays(5) });
gantt.TaskMoving += (sender, e) => e.Cancel = e.Start < DateTime.Today;
Controls.Add(gantt);

Constructors​

Instance member GanttView()​

Creates an empty weekly project timeline.

Properties​

Instance member AllowDrag​

Boolean: Gets or sets whether users may move task bars. (Default: True)

Boolean: Gets or sets whether users may drag finish-to-start dependency links. (Default: True)

Instance member AllowResize​

Boolean: Gets or sets whether users may drag bar endpoints or completion handles. (Default: True)

Instance member CriticalPath​

Boolean: Gets or sets whether zero-slack tasks are highlighted. (Default: False)

Instance member DataSource​

Object: Gets or sets an IEnumerable or IListSource. IBindingList changes refresh task projections. (Default: null)

Instance member DependsOnMember​

String: Gets or sets the bound member used for DependsOn. Empty optional mappings use defaults. (Default: "DependsOn")

Instance member EndMember​

String: Gets or sets the bound member used for End. Empty optional mappings use defaults. (Default: "End")

Instance member IdMember​

String: Gets or sets the bound member used for Id. Empty optional mappings use defaults. (Default: "Id")

Instance member MilestoneMember​

String: Gets or sets the bound member used for Milestone. Empty optional mappings use defaults. (Default: "Milestone")

Instance member MilestoneText​

String: Gets or sets the localized override for the "milestone" text. (Default: null)

The default is null, which selects the built-in translation for the current UI culture. The getter returns the configured override. An empty string suppresses the text without changing the operation.

Instance member NoTasksText​

String: Gets or sets the localized override for the "No project tasks" text. (Default: null)

The default is null, which selects the built-in translation for the current UI culture. The getter returns the configured override. An empty string suppresses the text without changing the operation.

Instance member ParentIdMember​

String: Gets or sets the bound member used for ParentId. Empty optional mappings use defaults. (Default: "ParentId")

Instance member ProgressMember​

String: Gets or sets the bound member used for Progress. Empty optional mappings use defaults. (Default: "Progress")

Instance member ShowProgress​

Boolean: Gets or sets whether completion fills and drag handles are visible. (Default: True)

Instance member ShowToday​

Boolean: Gets or sets whether the current date marker is visible. (Default: True)

Instance member StartMember​

String: Gets or sets the bound member used for Start. Empty optional mappings use defaults. (Default: "Start")

Instance member TaskHeaderText​

String: Gets or sets the localized override for the "TASK" text. (Default: null)

The default is null, which selects the built-in translation for the current UI culture. The getter returns the configured override. An empty string suppresses the text without changing the operation.

Instance member TaskListWidth​

Int32: Gets or sets the task-list width in pixels. (Default: 260)

Instance member Tasks​

GanttTaskCollection: Gets the owned tasks. Assigning DataSource replaces these with bound projections.

Instance member TextMember​

String: Gets or sets the bound member used for Text. Empty optional mappings use defaults. (Default: "Text")

Instance member TimeScale​

GanttTimeScale: Gets or sets the timeline header scale. (Default: Weeks)

Instance member TodayText​

String: Gets or sets the localized override for the "TODAY" text. (Default: null)

The default is null, which selects the built-in translation for the current UI culture. The getter returns the configured override. An empty string suppresses the text without changing the operation.

Instance member ToneMember​

String: Gets or sets the bound member used for Tone. Empty optional mappings use defaults. (Default: "Tone")

Instance member WeekNumberText​

String: Gets or sets the localized override for the "W{0}" text. (Default: null)

The default is null, which selects the built-in translation for the current UI culture. The getter returns the configured override. An empty string suppresses the text without changing the operation. {0} is the week number. Literal braces can be written as {{ and }}.

Instance member WorkCalendar​

GanttWorkCalendar: Gets the working calendar used by dragging, background shading and critical-path duration.

Methods​

Instance member AddDependency(predecessor, successor)​

Proposes a finish-to-start link, rejecting duplicate links, cycles and a successor beginning before its predecessor ends.

ParameterTypeDescription
predecessorGanttTaskThe predecessor passed to the operation.
successorGanttTaskThe successor passed to the operation.

Returns: Boolean.

Protected member Dispose(disposing)​

Releases binding and model event subscriptions.

ParameterTypeDescription
disposingBooleantrue to release managed and unmanaged resources; false to release only unmanaged resources.

Instance member ExpandAll()​

Expands every hierarchy branch.

Instance member GetCriticalTaskIds()​

Returns zero-slack task identities using a duration-based finish-to-start critical path. Explicit gaps in scheduled dates are not constraints.

Returns: String[].

Protected member OnDependencyCreated(e)​

Raises DependencyCreated for subscribers and derived controls.

ParameterTypeDescription
eGanttDependencyEventArgsThe event data.

Protected member OnProgressChanged(e)​

Raises ProgressChanged for subscribers and derived controls.

ParameterTypeDescription
eGanttTaskChangeEventArgsThe event data.

Protected member OnTaskClick(e)​

Raises TaskClick for subscribers and derived controls.

ParameterTypeDescription
eGanttTaskEventArgsThe event data.

Protected member OnTaskDoubleClick(e)​

Raises TaskDoubleClick for subscribers and derived controls.

ParameterTypeDescription
eGanttTaskEventArgsThe event data.

Protected member OnTaskMoved(e)​

Raises TaskMoved for subscribers and derived controls.

ParameterTypeDescription
eGanttTaskChangeEventArgsThe event data.

Protected member OnTaskMoving(e)​

Raises TaskMoving for subscribers and derived controls.

ParameterTypeDescription
eGanttTaskChangeEventArgsThe event data.

Protected member OnTaskResized(e)​

Raises TaskResized for subscribers and derived controls.

ParameterTypeDescription
eGanttTaskChangeEventArgsThe event data.

Protected member OnWebEvent(e)​

Dispatches client requests to validated processors.

ParameterTypeDescription
eWisejEventArgsThe event data.

Protected member OnWebRender(config)​

Renders independent widget properties and a revisioned task snapshot.

ParameterTypeDescription
configObjectThe config passed to the operation.

Instance member RefreshData()​

Rebuilds bound task projections. Task ids must be unique; use IdMember for stable identities.

Instance member RescheduleTask(task, start, end, resize)​

Proposes new dates atomically. A move preserves working duration and shifts off non-working starts; resize preserves the requested exclusive end.

ParameterTypeDescription
taskGanttTaskThe task passed to the operation.
startDateTimeThe start passed to the operation.
endDateTimeThe end passed to the operation.
resize optionalBooleanThe resize passed to the operation. The default is false.

Returns: Boolean.

Instance member ScrollTo(date)​

Scrolls the timeline to a calendar date.

ParameterTypeDescription
dateDateTimeThe date passed to the operation.

Instance member SetExpanded(task, expanded)​

Expands or collapses a task branch without changing task ownership.

ParameterTypeDescription
taskGanttTaskThe task passed to the operation.
expandedBooleanThe expanded passed to the operation.

Instance member SetTaskProgress(task, progress)​

Proposes a completion percentage between zero and 100.

ParameterTypeDescription
taskGanttTaskThe task passed to the operation.
progressDoubleThe progress passed to the operation.

Returns: Boolean.

Events​

Instance member DependencyCreated​

EventHandler<GanttDependencyEventArgs> Occurs before a valid dependency is committed; Cancel rejects the link.

Instance member ProgressChanged​

EventHandler<GanttTaskChangeEventArgs> Occurs after an accepted completion change. Cancellation belongs to TaskMoving.

Instance member TaskClick​

EventHandler<GanttTaskEventArgs> Occurs when a task is activated.

Instance member TaskDoubleClick​

EventHandler<GanttTaskEventArgs> Occurs when a task is double-clicked.

Instance member TaskMoved​

EventHandler<GanttTaskChangeEventArgs> Occurs after an accepted move. Cancellation belongs to TaskMoving.

Instance member TaskMoving​

EventHandler<GanttTaskChangeEventArgs> Occurs at drop before Move, Resize or Progress is committed; Cancel rejects the edit.

Instance member TaskResized​

EventHandler<GanttTaskChangeEventArgs> Occurs after an accepted resize. Cancellation belongs to TaskMoving.

Implements​

NameDescription
IUserDataProvides access to the UserData and Tag properties associated to the component implementing this interface.
IBindableComponentBindable components implement this interface.
IDropTargetControls that support drag & drop operations implement this interface.
IWisejComponentAll wisej components implement this interface.
IWisejControlAll wisej controls derived from the Control class must implement this interface.
IWisejSerializableAllows an object to serialize itself.