To reproduce: click (mouse down) on a task but then release the mouse button off the task. It then stays selected even when I click on other tasks. You can repeat this over and over and end up with every task as "selected" as shown in the video. Workaround: AddHandler Me.RadGanttView1.GraphicalViewItemFormatting, AddressOf GraphicalViewItemFormatting Private Sub GraphicalViewItemFormatting(sender As Object, e As GanttViewGraphicalViewItemFormattingEventArgs) Dim taskItem As GanttViewTaskItemElement = TryCast(e.ItemElement, GanttViewTaskItemElement) If taskItem IsNot Nothing AndAlso taskItem.TaskElement.VisualState.Contains(".MouseDown") AndAlso Not taskItem.Selected Then taskItem.TaskElement.IsMouseDown = False End If End Sub
Hey,
We have a problem with the GanttViewTimeLineContainer as you see in the screeshot : gantt_print2.png
When we are in TimeLineRange = TimeRange.Year and we print the gantt, we have a problem with the appearence of GanttViewTimeLineContainer, we can see the first line with the year (it's ok) but after, the second line we can see a reperition of all month : jfmamjjasond jfmamjjasond jfmamjjasond jfmamjjasond etc etc etc
Can we change the appearence ? Do you have an explanation for this visualization ?
Thank you,
Regards,
Valériane E.
To reproduce: run the sample project and try to move a task. Workaround: Timer timer = new Timer(); private void DragDropService_Stopped(object sender, EventArgs e) { timer = new Timer(); timer.Interval = 300; timer.Tick += timer_Tick; } private void timer_Tick(object sender, EventArgs e) { timer.Stop(); data.Tables["Tasks"].Clear(); } Workaround 2: private void radGanttView1_ItemElementCreating(object sender, Telerik.WinControls.UI.GanttViewItemElementCreatingEventArgs e) { if (e.Item.Items.Count == 0 && e.ViewElement is GanttViewGraphicalViewElement) { e.ItemElement = new MyGanttViewTaskItemElement(e.ViewElement as GanttViewGraphicalViewElement); } } public class MyGanttViewTaskItemElement : GanttViewTaskItemElement { public MyGanttViewTaskItemElement(GanttViewGraphicalViewElement ganttViewBaseViewElement) : base(ganttViewBaseViewElement) { } protected override Type ThemeEffectiveType { get { return typeof(GanttViewTaskItemElement); } } public override void Detach() { var obj = this.Data; this.Data.SuspendPropertyNotifications(); base.Detach(); obj.ResumePropertyNotifications(); } public override void Synchronize() { DataSet ds = this.Data.GanttViewElement.DataSource as DataSet; if (ds != null && this.Data != null) { DataRowView rowView = this.Data.DataBoundItem as DataRowView; if (rowView != null && !RowExists(rowView.Row))//!ds.Tables[0].Rows.Contains(rowView.Row)) { return; } } base.Synchronize(); } private bool RowExists(DataRow dataRow) { DataSet ds = this.Data.GanttViewElement.DataSource as DataSet; bool res = false; foreach (DataRow r in ds.Tables[0].Rows) { if (r.Equals(dataRow)) { return true; } } return res; } }
To reproduce: - Set the range to lest than one day. - Set the TimelineRange to DayHalfHours Workaround: Make sure that the range is at least one day.
To reproduce: 1) Open the Demo application >> Settings example. 2) Select a task and activate the editor for it. 3) Delete the task by clicking the button above. It may be necessary to repeat the steps several times. The error is not reproduced immediately.
If one applies a TypeConverter with standard values to a property, this type converter is not used to convert these standard values to and from string when they are displayed in a drop down list editor.
To reproduce: Open QSF, go to GanttView, open the Settings example, go to the very last task and change the view mode to month. You will notice that the positions of the tasks are not being updated
To reproduce: Add Tasks which appear far after the start of the timeline. You will notice that some of them are not displayed at the right position.
Please run the attached sample project. Select one of the child tasks and click the button. The new task is expected to be inserted at the selected item's position. However, it is appended at the bottom as it is demonstrated in the gif file.
Workaround: rebind RadGanttView after inserting a new row to the DataTable:
Private Sub RadButton1_Click(sender As Object, e As EventArgs) Handles RadButton1.Click
Please refer to the attached sample project and run it. Select a random item and press the button. You will obtain the error. If no selection is available, the item is removed as expected.
Workaround: use Begin/EndUpdate block while deleting a record from the DataTable:
The latest release of WinForms causes a fatal exception when adding an item to a BindingList that is used in a RadGridView and a RadGanttView.
The first time an item is added there is not issue.
The second time an item is added, the following exception occurs.
System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.WinControls.UI.GanttViewBindingProvider.GanttTaskList.IndexOf(Object key)
at Telerik.WinControls.UI.GanttViewBindingProvider.GanttTaskList.get_Item(Object key)
at Telerik.WinControls.UI.GanttViewBindingProvider.AddTaskByCM(CurrencyManager cm, Int32 index)
at System.ComponentModel.ListChangedEventHandler.Invoke(Object sender, ListChangedEventArgs e)
at System.Windows.Forms.CurrencyManager.OnListChanged(ListChangedEventArgs e)
at System.Windows.Forms.CurrencyManager.List_ListChanged(Object sender, ListChangedEventArgs e)
at System.ComponentModel.BindingList`1.OnListChanged(ListChangedEventArgs e)
at System.ComponentModel.BindingList`1.FireListChanged(ListChangedType type, Int32 index)
at MissileWarningThreatPlanner.EventWindow.EventList.GenMissileEventWorker_RunWorkerCompleted(Object sender, RunWorkerCompletedEventArgs e) in C:\Shape Source\VS\MissileWarningThreatPlanner - VS2010\MissileWarningThreatPlanner\EventWindow\EventList.cs:line 5329
at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(RunWorkerCompletedEventArgs e)
This is code that has not been modified for quite some time. There has been no issue until the latest release.
I do not have time to try to create a simple example to try to reproduce the error at this time. I will if possible.
For now, we are forced to revert to a previous version.
Ken...
Hi,
why is the datatype of the ChildMember/ParentMember item limited to Int32? This is a problem when displaying tasks or events from tables with string or UUID idents. It would be a more flexible control if the type could be any type. Should not be a big deal to change this or is it?
Thank you und kind regards
Karsten
To reproduce: add a RadGanttView and populate it with data. Use the GraphicalViewItemFormatting event in order to change the e.ItemElement.TaskElement.Text. However, the changes are not applied. Workaround: private void radGanttView1_GraphicalViewItemFormatting(object sender, GanttViewGraphicalViewItemFormattingEventArgs e) { e.ItemElement.Tag = "Custom text"; } public class CustomRadGanttView : RadGanttView { protected override RadGanttViewElement CreateGanttViewElement() { return new CustomRadGanttViewElement(); } public override string ThemeClassName { get { return typeof(RadGanttView).FullName; } } } public class CustomRadGanttViewElement : RadGanttViewElement { public CustomRadGanttViewElement() { } protected override Type ThemeEffectiveType { get { return typeof(RadGanttViewElement); } } protected override GanttViewGraphicalViewElement CreateGraphicalViewElement(RadGanttViewElement ganttView) { return new CustomGanttViewGraphicalViewElement(ganttView); } } public class CustomGanttViewGraphicalViewElement : GanttViewGraphicalViewElement { public CustomGanttViewGraphicalViewElement(RadGanttViewElement ganttView) : base(ganttView) { } protected override Type ThemeEffectiveType { get { return typeof(GanttViewGraphicalViewElement); } } protected override IVirtualizedElementProvider<GanttViewDataItem> CreateElementProvider() { return new CustomGanttViewVirtualizedElementProvider(this); } } public class CustomGanttViewVirtualizedElementProvider : GanttViewVirtualizedElementProvider { public CustomGanttViewVirtualizedElementProvider(GanttViewBaseViewElement owner) : base(owner) { } public override IVirtualizedElement<GanttViewDataItem> CreateElement(GanttViewDataItem data, object context) { IVirtualizedElement<GanttViewDataItem> taskElement = base.CreateElement(data, context) ; if (taskElement is GanttViewTaskItemElement) { FieldInfo fi = typeof(GanttViewVirtualizedElementProvider).GetField("owner", BindingFlags.NonPublic | BindingFlags.Instance); GanttViewBaseViewElement owner = fi.GetValue(this) as GanttViewBaseViewElement ; return new CustomGanttViewTaskItemElement(owner as GanttViewGraphicalViewElement); } return taskElement; } } public class CustomGanttViewTaskItemElement:GanttViewTaskItemElement { public CustomGanttViewTaskItemElement(GanttViewGraphicalViewElement owner) : base(owner) { } public override void Synchronize() { base.Synchronize(); if (this.Tag != null) { this.TaskElement.Text = this.Tag.ToString(); } } }
To reproduce: please run the sample project and follow the steps illustrated in the attached gif file. This shows how I’m attempting to add children to a root task. Upon adding a child task I am unable to scroll down to see the rest of the pre-existent root tasks until I first collapse and expand any visible root or child task. Workaround: public RadForm2() { InitializeComponent(); this.radGanttView1.ItemAdded += radGanttView1_ItemAdded; } private void radGanttView1_ItemAdded(object sender, Telerik.WinControls.UI.GanttViewItemAddedEventArgs e) { item = e.Item; } GanttViewDataItem item; private void radButton1_Click(object sender, EventArgs e) { this.radGanttView1.GanttViewElement.InvalidateMeasure(true); this.radGanttView1.GanttViewElement.UpdateLayout(); this.radGanttView1.GanttViewElement.GraphicalViewElement.Scroller.ScrollToItem(item); }
To reproduce: have a look at the attached gif file and sample project. Workaround: this.radGanttView1.CursorChanged += radGanttView1_CursorChanged; this.radGanttView1.MouseMove += radGanttView1_MouseMove; private void radGanttView1_MouseMove(object sender, MouseEventArgs e) { GanttViewGraphicalViewElement view = this.radGanttView1.ElementTree.GetElementAtPoint(e.Location).FindAncestor<GanttViewGraphicalViewElement>(); Console.WriteLine(this.radGanttView1.ElementTree.GetElementAtPoint(e.Location)); if (view != null) isOverGraphicalView = true; else isOverGraphicalView = false; } bool isOverGraphicalView = false; private void radGanttView1_CursorChanged(object sender, EventArgs e) { if (isOverGraphicalView) { this.radGanttView1.CursorChanged -= radGanttView1_CursorChanged; this.radGanttView1.Cursor = Cursors.Default; this.radGanttView1.CursorChanged += radGanttView1_CursorChanged; } }
To reproduce: public RadForm1() { InitializeComponent(); DataTable tasks = new DataTable("Tasks"); tasks.Columns.Add("Id", typeof(int)); tasks.Columns.Add("ParentId", typeof(int)); tasks.Columns.Add("Title", typeof(string)); tasks.Columns.Add("Start", typeof(DateTime)); tasks.Columns.Add("End", typeof(DateTime)); tasks.Columns.Add("Progress", typeof(decimal)); DataTable links = new DataTable("Links"); links.Columns.Add("StartId", typeof(int)); links.Columns.Add("EndId", typeof(int)); links.Columns.Add("LinkType", typeof(int)); tasks.Rows.Add(1, 0, "Summary task title", new DateTime(2010, 10, 8), new DateTime(2010, 10, 18), 30m); tasks.Rows.Add(2, 1, "First child task title", new DateTime(2010, 10, 10), new DateTime(2010, 10, 12), 10); tasks.Rows.Add(3, 1, "Second child task title", new DateTime(2010, 10, 12), new DateTime(2010, 10, 15), 20m); tasks.Rows.Add(4, 1, "Milestone", new DateTime(2010, 10, 15), new DateTime(2010, 10, 15), 0m); links.Rows.Add(2, 3, 1); links.Rows.Add(3, 4, 1); DataSet data = new DataSet(); data.Tables.Add(tasks.Copy()); data.Tables.Add(links); this.radGridView1.DataSource = tasks; radGridView1.BestFitColumns(); this.radGanttView1.CreateDataItem += radGanttView1_CreateDataItem; this.radGanttView1.AllowSummaryEditing = true; this.radGanttView1.GanttViewElement.TaskDataMember = "Tasks"; this.radGanttView1.GanttViewElement.ChildMember = "Id"; this.radGanttView1.GanttViewElement.ParentMember = "ParentId"; this.radGanttView1.GanttViewElement.TitleMember = "Title"; this.radGanttView1.GanttViewElement.StartMember = "Start"; this.radGanttView1.GanttViewElement.EndMember = "End"; this.radGanttView1.GanttViewElement.ProgressMember = "Progress"; this.radGanttView1.GanttViewElement.LinkDataMember = "Links"; this.radGanttView1.GanttViewElement.LinkStartMember = "StartId"; this.radGanttView1.GanttViewElement.LinkEndMember = "EndId"; this.radGanttView1.GanttViewElement.LinkTypeMember = "LinkType"; this.radGanttView1.GanttViewElement.DataSource = data; this.radGanttView1.Columns.Add("Start"); this.radGanttView1.Columns.Add("End"); this.radGanttView1.Columns.Add("Progress"); this.radGanttView1.GanttViewElement.GraphicalViewElement.TimelineStart = new DateTime(2010, 10, 7); this.radGanttView1.GanttViewElement.GraphicalViewElement.TimelineEnd = new DateTime(2010, 12, 10); } You will notice that the start and end of the summary task are changed in the gantt view. Workaround: void radGanttView1_CreateDataItem(object sender, CreateGanttDataItemEventArgs e) { e.Item = new MyGanttViewDataItem(); } public class MyGanttViewDataItem : GanttViewDataItem { protected override void OnChildAdded(GanttViewDataItem child) { if (this.Parent != null && !this.GanttViewElement.AllowSummaryEditing) { base.OnChildAdded(child); } } protected override void OnChildRemoved(GanttViewDataItem child) { if (this.Parent != null && !this.GanttViewElement.AllowSummaryEditing) { base.OnChildRemoved(child); } } }
To reproduce: populate RadGanttView with data and hide some of the columns in a button's Click event: Private Sub RadButton1_Click(sender As Object, e As EventArgs) Handles RadButton1.Click Me.RadGanttView1.GanttViewElement.Columns(0).Visible = False End Sub The column is not hidden until you move the splitter. Workaround: Private Sub RadButton1_Click(sender As Object, e As EventArgs) Handles RadButton1.Click Me.RadGanttView1.GanttViewElement.Columns(0).Visible = False Me.RadGanttView1.GanttViewElement.InvalidateMeasure(True) Me.RadGanttView1.GanttViewElement.UpdateLayout() End Sub
To reproduce: public RadForm1() { InitializeComponent(); DataSet ds = new DataSet(); DataTable dt = new DataTable(); dt.TableName = "Tasks"; dt.Columns.Add("Id"); dt.Columns.Add("ParentID"); dt.Columns.Add("Title"); dt.Columns.Add("Start", typeof(DateTime)); dt.Columns.Add("End", typeof(DateTime)); dt.Rows.Add("1", "", "Item1", new DateTime(2018,03,16), new DateTime(2018,03,20)); dt.Rows.Add("2", "1", "child", new DateTime(2018,03,16), new DateTime(2018,03,17)); dt.Rows.Add("3", "", "Item2", new DateTime(2018,03,16), new DateTime(2018,03,20)); ds.Tables.Add(dt); this.radGanttView1.GanttViewElement.TaskDataMember = "Tasks"; this.radGanttView1.GanttViewElement.ChildMember = "Id"; this.radGanttView1.GanttViewElement.ParentMember = "ParentId"; this.radGanttView1.GanttViewElement.TitleMember = "Title"; this.radGanttView1.GanttViewElement.StartMember = "Start"; this.radGanttView1.GanttViewElement.EndMember = "End"; this.radGanttView1.GanttViewElement.DataSource = ds; this.radGanttView1.Columns.Add("Start"); this.radGanttView1.Columns.Add("End"); this.radGanttView1.GanttViewElement.GraphicalViewElement.TimelineStart = new DateTime(2018,03,10); this.radGanttView1.GanttViewElement.GraphicalViewElement.TimelineEnd = new DateTime(2018,03,31); //"child" item is readonly radGanttView1.Items[0].ReadOnly = true; } Workaround: public class CustomBaseGanttViewBehavior : BaseGanttViewBehavior { protected override void ProcessMouseDownOnTaskElement(GanttGraphicalViewBaseTaskElement element, MouseEventArgs e) { GanttGraphicalViewBaseItemElement taskItem = element.Parent as GanttGraphicalViewBaseItemElement; if (e.Button == MouseButtons.Left && !taskItem.Data.ReadOnly) { base.ProcessMouseDownOnTaskElement(element, e); } } }