public GanttViewItemElementCreatingEventArgs( GanttViewDataItem item, GanttViewBaseViewElement viewElement) : base(item) { this.viewElement = viewElement; }
public GanttViewTextViewItemFormattingEventArgs( GanttViewDataItem item, GanttViewTextItemElement itemElement) : base(item) { this.itemElement = itemElement; }
public GanttViewGraphicalViewItemFormattingEventArgs( GanttViewDataItem item, GanttGraphicalViewBaseItemElement itemElement) : base(item) { this.itemElement = itemElement; }
public override bool IsCompatible(GanttViewDataItem data, object context) { if (data != null && data.Items.Count > 0) { return(data.Start != data.End); } return(false); }
public GanttViewItemEditingEventArgs( GanttViewDataItem item, GanttViewTextViewColumn column, IInputEditor editor) : base(item) { this.column = column; this.editor = editor; }
public GanttViewTextViewCellFormattingEventArgs( GanttViewDataItem item, GanttViewTextViewCellElement cellElement, GanttViewTextViewColumn column) : base(item) { this.cellElement = cellElement; this.column = column; }
public GanttViewItemDataErrorEventArgs( GanttViewDataItem item, string errorText, params object[] context) : base(item) { this.errorText = errorText; this.context = context; }
public GanttViewItemValidatingEventArgs( GanttViewDataItem item, GanttViewTextViewColumn column, object newValue, object oldValue) : base(item) { this.column = column; this.newValue = newValue; this.oldValue = oldValue; }
private void radButtonElementAddMilestone_Click(object sender, EventArgs e) { if (this.radGanttView1.GanttViewElement.SelectedItem != null) { GanttViewDataItem newItem = new GanttViewDataItem(); newItem.Start = this.radGanttView1.GanttViewElement.SelectedItem.Start; newItem.End = newItem.Start; newItem.Title = "<new milestone>"; this.radGanttView1.GanttViewElement.SelectedItem.Items.Insert(0, newItem); } }
protected override void ProcessMouseMoveWhenResizingTask(GanttGraphicalViewBaseTaskElement element, MouseEventArgs e) { GanttViewDataItem data = ((GanttGraphicalViewBaseItemElement)element.Parent).Data; DateTime baseDate = this.IsResizingStart ? data.Start : data.End; Point mousePosition = this.GanttViewElement.GraphicalViewElement.PointFromControl(e.Location); int distanceFromLeftBorder = this.GanttViewElement.GraphicalViewElement.HorizontalScrollBarElement.Value + mousePosition.X; DateTime newDate = this.GanttViewElement.GraphicalViewElement.TimelineBehavior.AdjustedTimelineStart.AddSeconds(distanceFromLeftBorder * this.GanttViewElement.GraphicalViewElement.OnePixelTime.TotalSeconds).AddSeconds(1); if (newDate.Hour == 0 && newDate.Minute == 0 && newDate.Second == 0) { if (this.IsResizingStart) { DateTime maxStart = data.End.Subtract(new TimeSpan(this.GanttViewElement.GraphicalViewElement.OnePixelTime.Ticks * this.GanttViewElement.MinimumTaskWidth)); if (newDate > maxStart) { newDate = maxStart; } data.Start = newDate; } else if (this.IsResizingEnd) { DateTime minEnd = data.Start.Add(new TimeSpan(this.GanttViewElement.GraphicalViewElement.OnePixelTime.Ticks * this.GanttViewElement.MinimumTaskWidth)); if (newDate < minEnd) { newDate = minEnd; } data.End = newDate; } } this.ProcessScrolling(this.GanttViewElement.ElementTree.Control.PointToScreen(e.Location), false); foreach (GanttViewLinkDataItem link in this.GanttViewElement.Links) { if (link.StartItem == data || link.EndItem == data) { this.GanttViewElement.GraphicalViewElement.CalculateLinkLines(link, null); } } element.Parent.InvalidateMeasure(true); this.GanttViewElement.GraphicalViewElement.Invalidate(); }
protected override void SetHintWindowPosition(Point mousePt) { int dragDistance = mousePt.X - this.dragStartPoint.X; GanttViewDataItem dataItem = (((GanttGraphicalViewBaseTaskElement)this.Context).Parent as GanttGraphicalViewBaseItemElement).Data; DateTime startDate = dataItem.Start; DateTime newDate = startDate.AddTicks(this.Owner.GraphicalViewElement.OnePixelTime.Ticks * dragDistance); this.snappedDate = new DateTime((long)Math.Floor((decimal)(newDate.Ticks / TimeSpan.TicksPerDay)) * TimeSpan.TicksPerDay); RectangleF rectF = this.Owner.GraphicalViewElement.GetDrawRectangle(dataItem, snappedDate); Point rectLocation = Point.Round(rectF.Location); Point snapToDatePoint = this.Owner.GraphicalViewElement.PointToScreen(rectLocation); int mouseOffset = this.dragStartPoint.X - ((GanttGraphicalViewBaseTaskElement)this.Context).PointToScreen(new Point(0, 0)).X; Point newMousePt = new Point(snapToDatePoint.X + mouseOffset, mousePt.Y); base.SetHintWindowPosition(newMousePt); }
public GanttViewItemAddedEventArgs(GanttViewDataItem item) : base(item) { }
public GanttViewSelectedItemChangedEventArgs(GanttViewDataItem item) : base(item) { }
public GanttViewExpandedChangingEventArgs(GanttViewDataItem item) : base(item) { }
public GanttViewItemEditedEventArgs(GanttViewDataItem item, IInputEditor editor, bool commit) : base(item) { this.editor = editor; this.commit = commit; }
public GanttViewContextMenuOpeningEventArgs(GanttViewDataItem item, RadContextMenu menu) : base(item) { this.menu = menu; }
public GanttViewItemValidatedEventArgs(GanttViewDataItem item, GanttViewTextViewColumn column) : base(item) { this.column = column; }
public GanttViewItemDataBoundEventArgs(GanttViewDataItem item) : base(item) { }
public GanttViewItemChangedEventArgs(GanttViewDataItem item, string propertyName) : base(item) { this.propertyName = propertyName; }
protected internal virtual void CalculateLinkLines(GanttViewGraphicalViewElement viewElement, GanttViewDataItem item) { foreach (GanttViewLinkDataItem link in viewElement.GanttViewElement.Links) { if (link.StartItem == item || link.EndItem == item) { viewElement.CalculateLinkLines(link, null); } } }
public GanttViewItemChildIdNeededEventArgs(GanttViewDataItem item) : base(item) { }
public GanttViewItemEditorInitializedEventArgs(GanttViewDataItem item, IInputEditor editor) : base(item) { this.editor = editor; }
private void AddTasks() { //Setup data items GanttViewDataItem item1 = new GanttViewDataItem(); item1.Start = new DateTime(2014, 12, 15); item1.End = new DateTime(2014, 12, 20); item1.Progress = 30m; item1.Title = "Summary task.1. title"; GanttViewDataItem subItem11 = new GanttViewDataItem(); subItem11.Start = new DateTime(2014, 12, 16); subItem11.End = new DateTime(2014, 12, 18); subItem11.Progress = 10m; subItem11.Title = "Sub-task.1.1 title"; GanttViewDataItem subItem12 = new GanttViewDataItem(); subItem12.Start = new DateTime(2014, 12, 21); subItem12.End = new DateTime(2014, 12, 23); subItem12.Progress = 20m; subItem12.Title = "Sub-task.1.2 title"; //Add subitems item1.Items.Add(subItem11); item1.Items.Add(subItem12); this.customRadGanttView.Items.Add(item1); GanttViewDataItem item2 = new GanttViewDataItem(); item2.Start = new DateTime(2014, 12, 21); item2.End = new DateTime(2014, 12, 12); item2.Progress = 40m; item2.Title = "Summary task.2. title"; GanttViewDataItem subitem21 = new GanttViewDataItem(); subitem21.Start = new DateTime(2014, 12, 17); subitem21.End = new DateTime(2014, 12, 20); subitem21.Progress = 10m; subitem21.Title = "Sub-task.2.1 title"; GanttViewDataItem subitem22 = new GanttViewDataItem(); subitem22.Start = new DateTime(2014, 12, 21); subitem22.End = new DateTime(2014, 12, 23); subitem22.Progress = 30m; subitem22.Title = "Sub-task.2.2 title"; GanttViewDataItem subitem23 = new GanttViewDataItem(); subitem23.Start = new DateTime(2014, 12, 18); subitem23.End = new DateTime(2014, 12, 20); subitem23.Title = "Sub-task.2.3 title"; //Add subitems item2.Items.Add(subitem21); item2.Items.Add(subitem22); item2.Items.Add(subitem23); this.customRadGanttView.Items.Add(item2); //Add links between items GanttViewLinkDataItem link1 = new GanttViewLinkDataItem(); link1.StartItem = subItem11; link1.EndItem = subItem12; link1.LinkType = TasksLinkType.FinishToStart; this.customRadGanttView.Links.Add(link1); GanttViewLinkDataItem link2 = new GanttViewLinkDataItem(); link2.StartItem = subitem21; link2.EndItem = subitem22; link2.LinkType = TasksLinkType.StartToStart; this.customRadGanttView.Links.Add(link2); GanttViewLinkDataItem link3 = new GanttViewLinkDataItem(); link3.StartItem = subitem22; link3.EndItem = subitem23; link3.LinkType = TasksLinkType.FinishToStart; this.customRadGanttView.Links.Add(link3); GanttViewTextViewColumn titleColumn = new GanttViewTextViewColumn("Title"); GanttViewTextViewColumn startColumn = new GanttViewTextViewColumn("Start"); GanttViewTextViewColumn endColumn = new GanttViewTextViewColumn("End"); this.customRadGanttView.GanttViewElement.Columns.Add(titleColumn); this.customRadGanttView.GanttViewElement.Columns.Add(startColumn); this.customRadGanttView.GanttViewElement.Columns.Add(endColumn); }