ClassRadGanttView
Displays a hierarchical collection of task items along with the relations between them. Each item is represented by a GanttViewDataItem and each link is represented by a GanttViewLinkDataItem.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
[TelerikToolboxCategory("Data Controls")]
[ComplexBindingProperties("DataSource")]
[Docking(DockingBehavior.Ask)]
public class RadGanttView : RadControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IAnalyticsProvider, IPrintable
Inheritance: objectMarshalByRefObjectComponentControlScrollableControlRadControlRadGanttView
Implements:
Inherited Members
Constructors
RadGanttView()
Initializes a new instance of the RadGanttView class.
Declaration
public RadGanttView()
Fields
Properties
AllowSummaryEditing
Gets or sets a value indicating whether summary items are editable by the user or their value is auto-calculated from their sub items.
ChildMember
Gets or sets a property name which will be used to define a relation of the data items.
Columns
Gets the collection of columns shown in the GanttViewTextViewElement.
Declaration
[Browsable(true)]
public GanttViewTextViewColumnCollection Columns { get; }
Property Value
GanttViewTextViewColumnCollection
The columns.
CurrentColumn
Gets or sets the current column.
Declaration
[Browsable(false)]
public GanttViewTextViewColumn CurrentColumn { get; set; }
Property Value
DataProvider
Gets or sets a IGanttViewDataProvider instance, which enables integration with other controls.
Declaration
public IGanttViewDataProvider DataProvider { get; set; }
Property Value
The data provider.
DataSource
Gets or sets the data source that the RadGanttView is displaying data for.
DefaultSize
Gets the default size of the control.
DragDropService
Gets or sets the drag drop service.
Declaration
[Browsable(false)]
public GanttViewDragDropService DragDropService { get; set; }
Property Value
The drag drop service.
EnableCustomPainting
Gets or sets a value indicating whether custom painting is enabled.
Declaration
public bool EnableCustomPainting { get; set; }
Property Value
true if custom painting is enabled; otherwise, false.
EndMember
Gets or sets a property name which will be used to extract the end of the data items.
GanttViewBehavior
Gets or sets the gantt view behavior.
Declaration
[Browsable(false)]
public BaseGanttViewBehavior GanttViewBehavior { get; set; }
Property Value
The gantt view behavior.
GanttViewElement
Gets the gantt view element.
Declaration
[Browsable(false)]
public RadGanttViewElement GanttViewElement { get; }
Property Value
The gantt view element.
HeaderHeight
Gets or sets the height of the header row and the timeline container.
Declaration
public int HeaderHeight { get; set; }
Property Value
The height of the header.
IsDataBound
Gets a value indicating whether this instance is data bound.
Declaration
[Browsable(false)]
public bool IsDataBound { get; }
Property Value
true if this instance is data bound; otherwise, false.
IsEditing
Gets a value indicating whether this instance is in edit mode.
Declaration
public bool IsEditing { get; }
Property Value
true if this instance is in edit mode; otherwise, false.
IsInDesignMode
Gets or a value indicating whether the control is in design mode.
Declaration
[Browsable(false)]
public bool IsInDesignMode { get; }
Property Value
ItemHeight
Gets or sets the height of the items.
Declaration
public int ItemHeight { get; set; }
Property Value
The height of the item.
Items
Gets the collection of task items.
Declaration
[Browsable(true)]
public GanttViewDataItemCollection Items { get; }
Property Value
The task items.
LinkDataMember
Gets or sets the name of the list or table in the data source from which the RadGanttViewElement will extract links data.
Declaration
[Browsable(true)]
public string LinkDataMember { get; set; }
Property Value
LinkEndMember
Gets or sets a property name which will be used to extract the links end item.
LinkStartMember
Gets or sets a property name which will be used to extract links start item.
LinkTypeConverter
Gets or sets a link type converter that will be used to convert values coming from the data source to TasksLinkType and vice versa.
Declaration
[Browsable(false)]
public LinkTypeConverter LinkTypeConverter { get; set; }
Property Value
The link type converter.
LinkTypeMember
Gets or sets a property name which will be used to extract the link type of the data items.
Links
Gets the collection of links.
Declaration
[Browsable(true)]
public GanttViewLinkDataItemCollection Links { get; }
Property Value
GanttViewLinkDataItemCollection
The links.
ParentMember
Gets or sets a property name which will be used to define a relation of the data items.
PrintSettings
Gets or sets a GanttViewPrintSettings instance, which hold the default print settings.
Declaration
[Browsable(true)]
public GanttViewPrintSettings PrintSettings { get; set; }
Property Value
The print settings.
ProgressMember
Gets or sets a property name which will be used to extract the Progress of the data items.
RadContextMenu
Gets or sets the context menu associated with the control.
Declaration
public virtual RadContextMenu RadContextMenu { get; set; }
Property Value
A ContextMenu that represents the context menu associated with the control.
Ratio
Gets or sets the ratio between the text view and the graphical view.
ReadOnly
Gets or sets a value indicating whether the gantt view is read only.
Declaration
public bool ReadOnly { get; set; }
Property Value
true if the gantt view is read only; otherwise, false.
SelectedItem
Gets or sets the selected item.
Declaration
[Browsable(false)]
public GanttViewDataItem SelectedItem { get; set; }
Property Value
The selected item.
SelectedLink
Gets or sets the selected link.
Declaration
[Browsable(false)]
public GanttViewLinkDataItem SelectedLink { get; set; }
Property Value
The selected link.
ShowTimelineTodayIndicator
Gets or sets a value indicating whether to show the timeline today indicator.
Declaration
public bool ShowTimelineTodayIndicator { get; set; }
Property Value
true if the timeline today indicator is visible; otherwise, false.
ShowTodayIndicator
Gets or sets a value indicating whether to show the today indicator.
Declaration
public bool ShowTodayIndicator { get; set; }
Property Value
true if the today indicator is visible; otherwise, false.
SplitterWidth
Gets or sets the width of the splitter.
Declaration
public int SplitterWidth { get; set; }
Property Value
The width of the splitter.
StartMember
Gets or sets a property name which will be used to extract the start of the data items.
TaskDataMember
Gets or sets the name of the list or table in the data source from which the RadGanttViewElement will extract tasks data.
Declaration
[Browsable(true)]
public string TaskDataMember { get; set; }
Property Value
TitleMember
Gets or sets a property name which will be used to extract the title of the data items.
Methods
BeginPrint(RadPrintDocument, PrintEventArgs)
Called when the printing begins.
Declaration
public int BeginPrint(RadPrintDocument sender, PrintEventArgs args)
Parameters
sender
The that has initiated the printing.
args
The event args.
Returns
The number of pages that will be printed.
Implements
BeginUpdate()
Disables all notifications in the RadGanttView to improve performance during bulk operations.
Declaration
public void BeginUpdate()
CreateChildItems(RadElement)
Creates the child items.
Declaration
protected override void CreateChildItems(RadElement parent)
Parameters
parent
The parent.
Overrides
CreateGanttViewElement()
Creates and returns a new instance of RadGanttViewElement. This method can be overridden to provide custom element implementations.
Declaration
protected virtual RadGanttViewElement CreateGanttViewElement()
Returns
A new instance of RadGanttViewElement.
Dispose(bool)
Releases the unmanaged resources used by the RadGanttView and optionally releases the managed resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources.
Overrides
DrawCurrentPage(Graphics, int)
Draws the current page by slicing a portion of the big bitmap.
DrawHeaderAndTimelineViewToBitmap(Bitmap)
Draws the header and the timeline view items to bitmap.
Declaration
protected virtual void DrawHeaderAndTimelineViewToBitmap(Bitmap bmp)
Parameters
bmp
The BMP.
DrawHeaderCellsToBitmap(Graphics)
Draws the header cells to bitmap.
Declaration
protected virtual void DrawHeaderCellsToBitmap(Graphics g)
Parameters
g
The g.
DrawLinksToBitmap(Graphics)
Draws the links to the bitmap.
Declaration
protected virtual void DrawLinksToBitmap(Graphics g)
Parameters
g
The g.
DrawTextViewAndGraphicalViewToBitmap(Bitmap)
Draws the grid portion of the gantt view and the graphical view to the big bitmap.
Declaration
protected virtual void DrawTextViewAndGraphicalViewToBitmap(Bitmap bmp)
Parameters
bmp
The BMP.
DrawTextViewCellsAndTasksToBitmap(Graphics)
Draws the grid cells and graphical tasks to the bitmap.
Declaration
protected virtual void DrawTextViewCellsAndTasksToBitmap(Graphics g)
Parameters
g
The graphics.
DrawTimelineItemsToBitmap(Graphics)
Draws the timeline items to bitmap.
Declaration
protected virtual void DrawTimelineItemsToBitmap(Graphics g)
Parameters
g
The g.
EndPrint(RadPrintDocument, PrintEventArgs)
Called when the printing ends.
Declaration
public bool EndPrint(RadPrintDocument sender, PrintEventArgs args)
Parameters
sender
The that has initiated the printing.
args
The event args.
Returns
false if the printing was canceled
Implements
EndUpdate()
Re-enables notifications and updates the RadGanttView after bulk operations are completed.
Declaration
public void EndUpdate()
GetElementShape(GanttViewPrintElementContext, RectangleF)
Gets the shape of an element based on the print context and the provided rectangle.
Declaration
protected virtual PointF[] GetElementShape(GanttViewPrintElementContext context, RectangleF rect)
Parameters
context
The context.
rect
The rect.
Returns
PointF[]
GetFinishToFinishLines(GanttViewLinkDataItem, int, int)
Gets the finish to finish lines for the given link.
Declaration
protected virtual List<PointF> GetFinishToFinishLines(GanttViewLinkDataItem link, int startItemIndex, int endItemIndex)
Parameters
link
The link.
startItemIndex
The index of the link start item in a flat representation of the items hierarchy.
endItemIndex
The index of the link end item in a flat representation of the items hierarchy.
Returns
List<PointF>
GetFinishToStartLines(GanttViewLinkDataItem, int, int)
Gets the finish to start lines for the given link.
Declaration
protected virtual List<PointF> GetFinishToStartLines(GanttViewLinkDataItem link, int startItemIndex, int endItemIndex)
Parameters
link
The link.
startItemIndex
The index of the link start item in a flat representation of the items hierarchy.
endItemIndex
The index of the link end item in a flat representation of the items hierarchy.
Returns
List<PointF>
GetLinkLines(GanttViewLinkDataItem, int, int)
Gets the link lines for the given link.
Declaration
protected virtual List<PointF> GetLinkLines(GanttViewLinkDataItem link, int startItemIndex, int endItemIndex)
Parameters
link
The link.
startItemIndex
The index of the link start item in a flat representation of the items hierarchy.
endItemIndex
The index of the link end item in a flat representation of the items hierarchy.
Returns
List<PointF>
GetPrintElement(GanttViewPrintElementContext)
Gets an initialized print element based on the provided context.
Declaration
protected virtual GanttViewPrintElement GetPrintElement(GanttViewPrintElementContext context)
Parameters
context
The context.
Returns
GetPrintRectangle(GanttViewDataItem, int)
Returns a rectangle representing the coordinates where an object should be positioned or drawn for the given item and time frame.
Declaration
protected virtual RectangleF GetPrintRectangle(GanttViewDataItem item, int index)
Parameters
item
The item that will be printed.
index
The index of the item in a flat representation of the items hierarchy.
Returns
GetSettingsDialog(RadPrintDocument)
Gets a print settings dialog that is specific for the printable object.
Declaration
public Form GetSettingsDialog(RadPrintDocument document)
Parameters
document
The that has initiated the printing.
Returns
The dialog.
Implements
GetStartToFinishLines(GanttViewLinkDataItem, int, int)
Gets the start to finish lines for the given link.
Declaration
protected virtual List<PointF> GetStartToFinishLines(GanttViewLinkDataItem link, int startItemIndex, int endItemIndex)
Parameters
link
The link.
startItemIndex
The index of the link start item in a flat representation of the items hierarchy.
endItemIndex
The index of the link end item in a flat representation of the items hierarchy.
Returns
List<PointF>
GetStartToStartLines(GanttViewLinkDataItem, int, int)
Gets the start to start lines for the given link.
Declaration
protected virtual List<PointF> GetStartToStartLines(GanttViewLinkDataItem link, int startItemIndex, int endItemIndex)
Parameters
link
The link.
startItemIndex
The index of the link start item in a flat representation of the items hierarchy.
endItemIndex
The index of the link end item in a flat representation of the items hierarchy.
Returns
List<PointF>
IsInputKey(Keys)
Determines whether the pressed key is input key.
OnBindingContextChanged(EventArgs)
Raises the event.
OnKeyDown(KeyEventArgs)
Raises the event.
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
e
The KeyEventArgs instance containing the event data.
Overrides
OnKeyPress(KeyPressEventArgs)
Raises the event.
Declaration
protected override void OnKeyPress(KeyPressEventArgs e)
Parameters
e
The KeyPressEventArgs instance containing the event data.
Overrides
OnKeyUp(KeyEventArgs)
Raises the event.
Declaration
protected override void OnKeyUp(KeyEventArgs e)
Parameters
e
The KeyEventArgs instance containing the event data.
Overrides
OnMouseClick(MouseEventArgs)
Raises the MouseClick event.
Declaration
protected override void OnMouseClick(MouseEventArgs e)
Parameters
e
An MouseEventArgs that contains the event data.
Overrides
OnMouseDoubleClick(MouseEventArgs)
Raises the MouseDoubleClick event.
Declaration
protected override void OnMouseDoubleClick(MouseEventArgs e)
Parameters
e
An MouseEventArgs that contains the event data.
Overrides
OnMouseDown(MouseEventArgs)
Raises the event.
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
e
The MouseEventArgs instance containing the event data.
Overrides
OnMouseEnter(EventArgs)
Raises the event.
OnMouseHover(EventArgs)
Raises the event.
OnMouseLeave(EventArgs)
Raises the event.
OnMouseMove(MouseEventArgs)
Raises the event.
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
e
The MouseEventArgs instance containing the event data.
Overrides
OnMouseUp(MouseEventArgs)
Raises the event.
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
e
The MouseEventArgs instance containing the event data.
Overrides
OnMouseWheel(MouseEventArgs)
Raises the event.
Declaration
protected override void OnMouseWheel(MouseEventArgs e)
Parameters
e
The MouseEventArgs instance containing the event data.
Overrides
OnPrintElementFormatting(GanttViewPrintElementFormattingEventArgs)
Raises the event.
Declaration
protected virtual void OnPrintElementFormatting(GanttViewPrintElementFormattingEventArgs e)
Parameters
e
GanttViewPrintElementFormattingEventArgs
The GanttViewPrintElementFormattingEventArgs instance containing the event data.
OnPrintElementPaint(GanttViewPrintElementPaintEventArgs)
Raises the event.
Declaration
protected virtual void OnPrintElementPaint(GanttViewPrintElementPaintEventArgs e)
Parameters
e
GanttViewPrintElementPaintEventArgs
The GanttViewPrintElementPaintEventArgs instance containing the event data.
Print()
Directly prints the RadGanttView to the default printer.
Declaration
public virtual void Print()
Print(bool)
Directly prints the RadGanttView to the default printer or shows printer settings and then prints the RadGanttView.
Declaration
public virtual void Print(bool showPrinterSettings)
Parameters
showPrinterSettings
Indicates whether printer settings dialog should be shown.
Print(bool, RadPrintDocument)
Directly prints the RadGanttView to the default printer or shows printer settings and then prints the RadGanttView.
Declaration
public virtual void Print(bool showPrinterSettings, RadPrintDocument document)
Parameters
showPrinterSettings
Indicates whether printer settings dialog should be shown.
document
As instance of RadPrintDocument used to control the print process.
PrintGanttViewElement(Graphics, GanttViewPrintElementContext, RectangleF, string, object)
Prints a gantt view element to the graphics object.
Declaration
protected virtual void PrintGanttViewElement(Graphics g, GanttViewPrintElementContext context, RectangleF rect, string text, object dataItem)
Parameters
g
The Graphics object used for painting the element.
context
The print element context.
rect
The rectangle of the print element.
text
The text of the print element.
dataItem
The data item of the print element.
PrintGanttViewElement(Graphics, GanttViewPrintElementContext, RectangleF, string, object, string)
Prints a gantt view element to the graphics object.
Declaration
protected virtual void PrintGanttViewElement(Graphics g, GanttViewPrintElementContext context, RectangleF rect, string text, object dataItem, string columnName)
Parameters
g
The Graphics object used for painting the element.
context
The print element context.
rect
The rectangle of the print element.
text
The text of the print element.
dataItem
The data item of the print element.
columnName
The column name of the print element.
PrintPage(int, RadPrintDocument, PrintPageEventArgs)
Prints the page with the specified number.
Declaration
public bool PrintPage(int pageNumber, RadPrintDocument sender, PrintPageEventArgs args)
Parameters
pageNumber
The number of the current page.
sender
The that has initiated the printing.
args
The event args.
Returns
true if there are more pages, false otherwise
Implements
PrintPreview()
Shows a RadPrintPreviewDialog for editing the RadGanttView print settings.
Declaration
public virtual void PrintPreview()
PrintPreview(RadPrintDocument)
Shows a RadPrintPreviewDialog for editing the RadGanttView print settings.
Declaration
public virtual void PrintPreview(RadPrintDocument document)
Parameters
document
As instance of RadPrintDocument used to control the print process.
ProcessDialogKey(Keys)
Processes a dialog key.
WndProc(ref Message)
Handles windows messages.
Declaration
protected override void WndProc(ref Message m)
Parameters
m
The message.
Overrides
Events
ContextMenuOpening
Occurs when a context menu is about to be opened.
Declaration
public event GanttViewContextMenuOpeningEventHandler ContextMenuOpening
Event Value
CreateDataItem
Occurs when a new data item is created.
Declaration
public event CreateGanttDataItemEventHandler CreateDataItem
Event Value
CreateLinkDataItem
Occurs when a new link data item is created.
Declaration
public event CreateGanttLinkDataItemEventHandler CreateLinkDataItem
Event Value
DataCellElementCreating
Occurs when a new data cell element needs to be created.
Declaration
public event GanttViewDataCellElementCreatingEventHandler DataCellElementCreating
Event Value
GraphicalViewItemFormatting
Occurs when the state of an item in the GanttViewGraphicalViewElement changes and it needs to be formatted.
Declaration
public event GanttViewGraphicalViewItemFormattingEventHandler GraphicalViewItemFormatting
Event Value
GraphicalViewLinkItemFormatting
Occurs when the state of a link item in the GanttViewGraphicalViewElement changes and it needs to be formatted.
Declaration
public event GanttViewLinkItemFormattingEventHandler GraphicalViewLinkItemFormatting
Event Value
HeaderCellElementCreating
Occurs when a new header cell element needs to be created.
Declaration
public event GanttViewHeaderCellElementCreatingEventHandler HeaderCellElementCreating
Event Value
ItemAdded
Occurs when a new item is added to the Items collection.
Declaration
public event GanttViewItemAddedEventHandler ItemAdded
Event Value
ItemAdding
Occurs before an GanttViewDataItem is added to the Items collection.
Declaration
public event GanttItemAddingEventHandler ItemAdding
Event Value
ItemChanged
Occurs when an item's property is changed.
Declaration
public event GanttViewItemChangedEventhandler ItemChanged
Event Value
ItemChildIdNeeded
Occurs when an item needs an id for storing in data sources.
Declaration
public event GanttViewItemChildIdNeededEventHandler ItemChildIdNeeded
Event Value
ItemDataBound
Occurs when an item is data bound.
Declaration
public event GanttViewItemDataBoundEventHandler ItemDataBound
Event Value
ItemDataError
Occurs when there is an error in the data layer of RadGanttView related to data operations with Item objects.
Declaration
public event GanttItemDataErrorEventHandler ItemDataError
Event Value
ItemElementCreating
Occurs when an item element needs to be created.
Declaration
public event GanttViewItemElementCreatingEventHandler ItemElementCreating
Event Value
ItemExpandedChanged
Occurs after an item is expanded or collapsed.
Declaration
public event GanttViewExpandedChangedEventHandler ItemExpandedChanged
Event Value
ItemExpandedChanging
Occurs when an item is about to be expanded or collapsed.
Declaration
public event GanttViewExpandedChangingEventHandler ItemExpandedChanging
Event Value
ItemPaint
Occurs when an item is painted. Allows custom painting over the item. EnableCustomPainting must be set to true for this event to be fired.
Declaration
public event GanttViewItemPaintEventHandler ItemPaint
Event Value
ItemRemoved
Occurs when an item removed from the Items collection.
Declaration
public event GanttViewItemRemovedEventHandler ItemRemoved
Event Value
LinkAdded
Occurs when a new link added to the Links collection.
Declaration
public event GanttViewLinkAddedEventHandler LinkAdded
Event Value
LinkAdding
Occurs before an GanttViewLinkDataItem is added to the Links collection.
Declaration
public event GanttLinkAddingEventHandler LinkAdding
Event Value
LinkChanged
Occurs when a link's property is changed.
Declaration
public event GanttViewLinkChangedEventHandler LinkChanged
Event Value
LinkDataBound
Occurs when a link is data bound.
Declaration
public event GanttViewLinkDataBoundEventHandler LinkDataBound
Event Value
LinkDataError
Occurs when there is an error in the data layer of RadGanttView related to data operations with Link objects.
Declaration
public event GanttLinkDataErrorEventHandler LinkDataError
Event Value
LinkRemoved
Occurs when a link is removed from the Links collection.
Declaration
public event GanttViewLinkRemovedEventHandler LinkRemoved
Event Value
PrintElementFormatting
Occurs when an element will be printed. Allows formatting of the element.
Declaration
public event GanttViewPrintElementFormattingEventHandler PrintElementFormatting
Event Value
PrintElementPaint
Occurs after an element is printed. Allows for custom painting over the element.
Declaration
public event GanttViewPrintElementPaintEventHandler PrintElementPaint
Event Value
SelectedItemChanged
Occurs when selected item has been changed.
Declaration
public event GanttViewSelectedItemChangedEventHandler SelectedItemChanged
Event Value
SelectedItemChanging
Occurs when the selected item is about to be changed.
Declaration
public event GanttViewSelectedItemChangingEventHandler SelectedItemChanging
Event Value
SelectedLinkChanged
Occurs when selected link has been changed.
Declaration
public event GanttViewSelectedLinkChangedEventHandler SelectedLinkChanged
Event Value
SelectedLinkChanging
Occurs when the selected link is about to be changed.
Declaration
public event GanttViewSelectedLinkChangingEventHandler SelectedLinkChanging
Event Value
TextViewCellFormatting
Occurs when the content of a cell needs to be formatted for display.
Declaration
public event GanttViewTextViewCellFormattingEventHandler TextViewCellFormatting
Event Value
TextViewItemFormatting
Occurs when an item in the GanttViewTextViewElement state changes and it needs to be formatted.
Declaration
public event GanttViewTextViewItemFormattingEventHandler TextViewItemFormatting
Event Value
TimelineItemElementCreating
Occurs when a timeline item element needs to be created.
Declaration
public event GanttViewTimelineItemElementCreatingEventHandler TimelineItemElementCreating
Event Value
TimelineItemFormatting
Occurs when the state of a timeline item changes and it needs to be formatted.
Declaration
public event GanttViewTimelineItemFormattingEventHandler TimelineItemFormatting
Event Value