I am using TdbChart and the Gantt Series. I am also using the Gantt Drag tool. Series data is a bound to a Datesource to a MS/SQL query. (TadoQuery)
The Gantts are on a time line. All the Gantts are in one series.
I want my user to be able to move/resize the Gantts interactively and have the values write back to the database. How do I do this?
Thanks
Delphi 2006 Win32
Tchart 8.02 VCL
Writing Gantt valuies back to database
-
- Newbie
- Posts: 5
- Joined: Fri Sep 28, 2007 12:00 am
Hi SpringerRider,
I think you should use OnResizeBar and OnDragBar events to retrieve the new gantt values and do your sql queries. Here is how you could obtain the modified values in these events:
I think you should use OnResizeBar and OnDragBar events to retrieve the new gantt values and do your sql queries. Here is how you could obtain the modified values in these events:
Code: Select all
procedure TForm1.ChartTool1DragBar(Sender: TGanttTool; GanttBar: Integer);
begin
Chart1.Title.Text[0] := 'Bar Num: ' + inttostr(GanttBar) + ' StartValue: ' + FormatDateTime('c',Series1.StartValues[GanttBar]) + ' EndValue: ' + FormatDateTime('c', Series1.EndValues[GanttBar]);
end;
procedure TForm1.ChartTool1ResizeBar(Sender: TGanttTool; GanttBar: Integer;
BarPart: TGanttToolBarPart);
begin
Chart1.Title.Text[0] := 'Bar Num: ' + inttostr(GanttBar) + ' StartValue: ' + FormatDateTime('c', Series1.StartValues[GanttBar]) + ' EndValue: ' + FormatDateTime('c', Series1.EndValues[GanttBar]);
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |