I have an exception on a CheckDataSource method. I've made a Gantt chart bound with a DataSet. The following code works on TeeChart V3 Evaluation, but I had to work with the TeeChart V2. I installed the Update Build Version "TeeChartNET2UpdateBuild.exe", but the problem is still there.
There is my code in C# :
Code: Select all
private Steema.TeeChart.Styles.Gantt gantt1;
DataSetTest m_dt_Test = new DataSetTest();
// Binding
gantt1.DataSource = m_dt_Test.T_TASKS;
gantt1.EndValues.DataMember = "END";
gantt1.EndValues.DateTime = true;
gantt1.LabelMember = "NOM";
gantt1.StartValues.DataMember = "START";
gantt1.StartValues.DateTime = true;
gantt1.YValues.DataMember = "Y";
gantt1.ColorMember = "COLOR";
gantt1.XValues.DateTime = true;
string[] listPost = new string[4];
listPost[0] = "P1";
listPost[1] = "P2";
listPost[2] = "P3";
listPost[3] = "P5";
// Initialize the left axe
for (int key = 0; key < listPost.Length; ++key)
{
gantt1.Chart.Axes.Left.Labels.Items.Add(key, listPost[key]);
}
gantt1.Chart.Axes.Bottom.SetMinMax(DateTime.Now, DateTime.Now.AddDays(15));
gantt1.CheckDataSource(); // no problem, there is no data
m_dt_Test.T_TASKS.Rows.Clear();
DataSetTest.T_TASKSRow TaskRow = m_dt_Test.T_TASKS.NewT_TASKSRow();
TaskRow.COLOR = Color.Blue;
TaskRow.END = DateTime.Now.AddDays(4);
TaskRow.ID_TASK = 10;
TaskRow.NOM = "NAME";
TaskRow.NUM_GROUPE = 10;
TaskRow.START = DateTime.Now;
TaskRow.Y = 1;
m_dt_Test.T_TASKS.AddT_TASKSRow(TaskRow);
gantt1.CheckDataSource(); // there is the exception
Thanks for any help.