Posted 24 August 2020, 2:24 am EST
Hello Prabhat,
Thanks for your reply.
I’ve using this method to get the task information, as following
string queryTask = "SELECT * from tasks where category = '" + cmbCategory.Text + "' order by notes ";
MySqlDataAdapter TaskAdapter = new MySqlDataAdapter(queryTask, conn);
DataSet task = new DataSet();
TaskAdapter.Fill(task, "tasks");
//Setting Mappings in TasksStorage
this.c1GanttView1.DataStorage.TasksStorage.Mappings.CalendarID.MappingName = "CalendarID";
this.c1GanttView1.DataStorage.TasksStorage.Mappings.ConstraintDate.MappingName = "ConstraintDate";
this.c1GanttView1.DataStorage.TasksStorage.Mappings.ConstraintType.MappingName = "ConstraintType";
.
.
.
.
.
c1GanttView1.DataStorage.TasksStorage.DataSource = task.Tables[0];
And, what I have tried to add a custom field, as following
// Add a custom field column
C1.Win.C1GanttView.CustomFieldColumn customCol = new C1.Win.C1GanttView.CustomFieldColumn();
customCol.Caption = "Quantity";
customCol.DataType = typeof(string);
customCol.Name = "Quantity";
customCol.Visible = true;
c1GanttView1.Columns.Add(customCol);
this.c1GanttView1.DataStorage.TasksStorage.Mappings.CustomFields.MappingName = "Quantity";
There is an error showing out. I am not sure whether I am using in the correct method. Could you give me some advice?