This is a migrated thread and some comments may be shown as answers.

Adding the First Item to a Ganttview

3 Answers 105 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
Marius
Top achievements
Rank 1
Marius asked on 18 Feb 2016, 08:25 AM

Hi All

Me again ;)

I have tried to search, but cannot find the answer.

 

I have a DataSet I use for the gantview. All the properties is correct, but on the first time a user uses it, there is still no data, so it is an empty Dataset.

On this empty Gantview though, there is no Context Menu, so here is my question: How do a User add the First Task to an Empty Ganttview ?

 

Regards

 

Marius

3 Answers, 1 is accepted

Sort by
0
Marius
Top achievements
Rank 1
answered on 18 Feb 2016, 10:01 AM
I Found a work around, by simply adding a Menu Item to add a "Semi Blank" new task. Now however , I have an issue, that since my data is bound to an external Database, when something is deleted, I need to also deleted it from the remote Database. The Ganttview removes it from the displayed collection, but I am not able to "catch" the relevant item that is being deleted ( I checked ItemRemoved, but can not seem to find the ID of the item that was removed)
0
Marius
Top achievements
Rank 1
answered on 19 Feb 2016, 09:48 AM

Me Again :)

I have figured out how to delete my items:

DataSet newds = (DataSet)radGanttView1.DataSource;
List<int> newids = (from DataRow dr in newds.Tables["Tasks"].Rows select int.Parse(dr["ID"].ToString())).ToList();
MainForm._service.DeleteTask(newids);

 

public void DeleteTask(List<int> ExistingIDs)
{
List<> result = (from i in _db.where !ExistingIDs.Contains(i.ID) && i.IsDeleted == false select i).ToList();
foreach (tasktoDelete in result)
{
tasktoDelete.IsDeleted = true;
try
{
_db.SaveChanges();
}
catch (Exception se)
{
string error = se.Message;
}
}
}

Now this brought another interesting Issue to my attention. In Project Management, Linking Items most of the times creates dependencies, and Based on the Type of link There is certain things that need to happen to the relevant Child/Sibling Items i.e.

 

If an Item is Linked FinishToStart and I modify the Start Item's End Date, The Linked Childs StartDate needs to be moved on.

Now I can Handle this on the ItemChanged Event, But how can I easily pickup/get the relevant "Linked Items" ?

 

Regards

 

Marius

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 19 Feb 2016, 03:28 PM
Hello Marius,

Thank you for writing.
 
By default, RadGanttView offers a context menu allowing you to delete the selected item. Additional information is available here: http://docs.telerik.com/devtools/winforms/ganttview/context-menu/default-context-menu. Thus, when a certain item is removed from the bound RadGanttView, the associated links are automatically deleted as well.

In order to detect the affected links, you can iterate the RadGanttView.Links collection and find which links contain the deleted item as start/end item. Thus, you can extract the affected items as well.

I hope this information helps. Should you have further questions I would be glad to help.
 
Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
GanttView
Asked by
Marius
Top achievements
Rank 1
Answers by
Marius
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or