Katalogerna
PlexityHide

Home 

Products 

Downloads 

Our Shop 

Support 

Contact 


GTP.NET FAQ 10898


I want to click/doubleclick on an empty spot in the chart to create a new item in Gantt_ASP. Please note that this article refers to the GTP.NET
Jump to article- 2007-05-10 14:41:00 - Email plexityHide

Question

I'm currently evaluating the GTP.WEB component to visualize a online booking application. I've had no problem binding data and viewing it in the Gantt chart, but now I want to click/doubleclick on an empty spot in the chart to create a new item. So my question is what is the easiest way of accomplishing this? Which events should/could be used and how do I pass along the information about where in the chart I clicked?

Answer

Download the latest release 3.0.5.10 and you will have a new event on the Gantt_ASP called:

Gantt_ASP1.OnGanttRow_ClientClick

You can implement that with code looking more or less like this:

  void Gantt_ASP1_OnGanttRow_ClientClick(Gantt_ASP aGantt, GanttRowClickEventArgs e)
  {
    if (aGantt.MouseButton_ClientSide == 1 && e.ThisClickSelectedLink==null)
    {
        DataRow dr=dataSet1.Tables["timeitem"].NewRow();
        dr["owner"]=(e.Row.GridNode.ListItemWhenDataBound() as DataRowView)["id"];
        dr["start"]=aGantt.Gantt.DateScaler.PixelToTime(e.X);
        dr["stop"]=aGantt.Gantt.DateScaler.PixelToTime(e.X).AddDays(2);
        dataSet1.Tables["timeitem"].Rows.Add(dr);
    }
    LabelClickInfo.Text="You clicked GanttRow with id "+((e.Row.GridNode.ListItemWhenDataBound() as DataRowView)["id"]).ToString();
  }

This is the code currently running in the sample found here: http://www.plexityhide.nu/

 

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...