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