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

Date Range in Gantt chart with data bind

1 Answer 66 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
John Ngo
Top achievements
Rank 1
John Ngo asked on 03 Nov 2008, 04:56 PM
I saw some examples with binding gantt chart to daterange:
RadChart1.PlotArea.YAxis.AddRange((new DateTime(2007, 1, 1)).ToOADate(), (new DateTime(2008, 1, 1)).ToOADate(), ((new DateTime(2008, 1, 1)).ToOADate() - (new DateTime(2007, 1, 1)).ToOADate()) / 7);

How can I bind that to sqldatasource with 2 fields "DateStart" and "DateEnd"?

Thanks



1 Answer, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 06 Nov 2008, 03:49 PM
Hello John Ngo,

ToOADate is used, because RadChart does not have intrinsic support for DateTime values. In rder to get the data in suitable format you can use a select statement similar to this one:

SELECT (Cast MyDate AS FLOAT) + 2 AS MyFloatDate

Now, MyFloatDate will be float and the values will be the OLE Automation equivalents of the database dates. Hope this helps.

Greetings,
Ves
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Chart (Obsolete)
Asked by
John Ngo
Top achievements
Rank 1
Answers by
Ves
Telerik team
Share this question
or