ILOG 甘特图 ActivityTable 去掉自动属性及其他

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qiqingli/article/details/79402816

在designer.cs文件中,自定义列之前加上`
this.activityTable1.Columns.Clear();

部分代码:

 this.activityTable1.Columns.Clear();
            this.activityTable1.Columns.AddRange(new ILOG.Views.Windows.Forms.TableColumn[] {
            this.tableColumn_CompleteState,
            this.tableColumn11,
            this.infoColumn1,
            this.treeColumn1,
            this.tableColumn15,
            this.tableColumn19,
            this.tableColumn10,
            this.tableColumnDesign,
            this.tableColumn17,
            this.tableColumn3,
            this.tableColumn4,
            this.tableColumn37,
            this.tableColumn2,
            this.tableColumn5,
            this.tableColumn13,
            this.tableColumn12,
            this.tableColumn14,
            this.tableColumn16,
            this.tableColumn18,
            this.tableColumn20});

自定义simGantModel

 this.simpleGanttModel.CustomActivityProperties.Add("RealStartTime", typeof(System.DateTime), System.DateTime.Now);
            this.simpleGanttModel.CustomActivityProperties.Add("RealEndTime", typeof(System.DateTime), System.DateTime.Now);
            this.simpleGanttModel.CustomActivityProperties.Add("Level", typeof(string), "");

适配器表名:

// 
            // genericGanttModelAdapter
            // 
            this.genericGanttModelAdapter.ActivitiesTableName = "表名";
            this.genericGanttModelAdapter.ActivityIDColumnName = "BAID";
            this.genericGanttModelAdapter.ActivityParentIDColumnName = "PID";
            this.genericGanttModelAdapter.ActivityProperties.Add(new ILOG.Views.Gantt.Data.GenericGanttModelAdapter.ColumnMapping("PName", "Name"));
            this.genericGanttModelAdapter.ActivityProperties.Add(new ILOG.Views.Gantt.Data.GenericGanttModelAdapter.ColumnMapping("Durations", "Duration"));
            this.genericGanttModelAdapter.ActivityProperties.Add(new ILOG.Views.Gantt.Data.GenericGanttModelAdapter.ColumnMapping("StartTime", "StartTime"));
            this.genericGanttModelAdapter.ActivityProperties.Add(new ILOG.Views.Gantt.Data.GenericGanttModelAdapter.ColumnMapping("CompleteTime", "EndTime"));
            this.genericGanttModelAdapter.ActivityProperties.Add(new ILOG.Views.Gantt.Data.GenericGanttModelAdapter.ColumnMapping("RealStartTime", "RealStartTime"));
            this.genericGanttModelAdapter.ActivityProperties.Add(new ILOG.Views.Gantt.Data.GenericGanttModelAdapter.ColumnMapping("RealEndTime", "RealEndTime"));
           this.genericGanttModelAdapter.AutoMilestone = true;
            this.genericGanttModelAdapter.ConstraintFromActivityIDColumnName = "约束列名";
            this.genericGanttModelAdapter.ConstraintsTableName = "前置表名";
            this.genericGanttModelAdapter.ConstraintToActivityIDColumnName = "被约束的列名";
            this.genericGanttModelAdapter.GanttModel = this.simpleGanttModel;
            this.genericGanttModelAdapter.ResourceIDColumnName = "资源列名";
            this.genericGanttModelAdapter.ResourceParentIDColumnName = "资源ID";
            this.genericGanttModelAdapter.ResourcesTableName = "资源表";

列控件:

        private ILOG.Views.Gantt.Windows.Forms.InfoColumn infoColumn1;
        private ILOG.Views.Windows.Forms.TreeColumn treeColumn1;
        private ILOG.Views.Windows.Forms.TableColumn tableColumn2;

猜你喜欢

转载自blog.csdn.net/qiqingli/article/details/79402816