Question
I would like to be able to double click on an item in the chart and have a popup window that modifies the data and writes it back to our database. How do I do this?
Answer
This is how you can find out the time item actually double clicked. To change it and update your DB; I leave that up to you, but the best approach would be to use databind for time items See the Gantt_Database or Gantt_DataBind sample in the general download.
private void gantt1_OnTimeItemAreaDoubleClick(object sender, System.EventArgs e)
{
if (gantt1.FocusedTimeItem!=null)
{
MessageBox.Show(gantt1.FocusedTimeItem.GanttRow.GridNode.Index.ToString()+”.”+gantt1.FocusedTimeItem.Index.ToString());
}
}
Or if you want find a time item from a given pixel (sample in VB.Net):
If Not selectedTI Is Nothing Then
MsgBox(selectedTI.GanttRow.GridNode.GetCell(0).Content.Value + ” Start:” + selectedTI.Start.ToString())
End If