Katalogerna
PlexityHide

Home 

Products 

Downloads 

Our Shop 

Support 

Contact 


GTP.NET FAQ 10892


I have difficulties with adding links to my Gantt (Databound). Please note that this article refers to the GTP.NET
Jump to article- 2007-05-09 20:52:00 - Email plexityHide

Question

I have difficulties with adding links to my Gantt (Databound). I do the following (see code below)to add the link to my dataset and get a nullReferenceException on the last line when adding the new row to the dataset.

 

What happens is that in your TimeItemLink.cs, UpdateValue() in the line int y = TimeItemLinks.IndexOf(aLink) the "list" variable used in IndexOf() is null.

 

Can you give me any clue on that please?

 

 

 

startItemRow = ((DataRowView)(linkStartItemUserData).First).Row;    // attivit? owner del link da creare;

        stopItemRow = ((DataRowView)((Pair)endItem.UserReference).First).Row;

        startId = Convert.ToInt32(startItemRow["ID"]);

        stopId = Convert.ToInt32(stopItemRow["ID"]);

 

       

        row = chartData.Tables["link"].NewRow();

        row["id"] = ++dataRowCount;

        row["owner"] = startId;

        row["target"] = stopId;

        row["link_type"] = "StartToFin";    //nuovo link sempre

        row["color"] = "blue";

        chartData.Tables["link"].Rows.Add(row);

Answer

It is important that the TimeItem set the Identity field when using databound links.

 

TimeItem.Identity:  Identity is used to tie databound timeitemlinks. Set Identity to the primary key for your time items. If the time items are databound; assign the TimeItemDataConnect.NameInDS_Identity to the primary key column of your time item row 

 

 

Google
WWW plexityHide GTP.NET FAQ
Support

Support intro

Knowledgebase

FAQ phGantTimePackage

FAQ GTP.NET

FAQ general

Testimonials

"This is too GREAT. I must say you have strong support and really good programmers at your place. Your entire team is good. Just Fantastic! – 100%"
Gaurav Patole,
WebTechDevelopers
More testimonials...