Beispiel #1
0
        private void Form1_FormClosed(object sender, FormClosedEventArgs e)
        {
            TreeListColumnCollection columns = this.treeList1.Columns;

            this.treeList1.ExportToXml(@"D:\TEMP\SQLite\treeListData.xml");
            this.treeList1.SaveLayoutToXml(@"D:\TEMP\SQLite\treeListLayout.xml");
        }
Beispiel #2
0
        public TreeListView()
        {
            this.DoubleBuffered = true;
            this.BackColor = SystemColors.Window;
            this.TabStop = true;

            m_tooltip = new ToolTip();
            m_tooltip.InitialDelay = 0;
            m_tooltip.UseAnimation = false;
            m_tooltip.UseFading = false;

            m_tooltipNode = null;
            m_tooltipTimer = new Timer();
            m_tooltipTimer.Stop();
            m_tooltipTimer.Interval = 500;
            m_tooltipTimer.Tick += new EventHandler(tooltipTick);

            m_rowPainter = new RowPainter();
            m_cellPainter = new CellPainter(this);

            m_nodes = new TreeListViewNodes(this);
            m_rowSetting = new TreeList.RowSetting(this);
            m_viewSetting = new TreeList.ViewSetting(this);
            m_columns = new TreeListColumnCollection(this);
            AddScrollBars();
        }
Beispiel #3
0
        public TreeListView()
        {
            this.DoubleBuffered = true;
            this.BackColor = SystemColors.Window;
            this.TabStop = true;

            m_rowPainter = new RowPainter();
            m_cellPainter = new CellPainter(this);

            m_nodes = new TreeListViewNodes(this);
            m_rowSetting = new TreeList.RowSetting(this);
            m_viewSetting = new TreeList.ViewSetting(this);
            m_columns = new TreeListColumnCollection(this);
            AddScrollBars();
        }
Beispiel #4
0
        private void SetFormat()
        {
            TreeListColumnCollection cols     = treeView.Columns;
            TreeListColumn           colLevel = cols["CAP"];

            colLevel.OptionsColumn.AllowEdit = true;
            colLevel.OptionsColumn.ReadOnly  = false;
            colLevel.Visible = true;

            DevExpress.XtraTreeList.StyleFormatConditions.StyleFormatCondition f1 = treeView.FormatConditions[0];
            f1.Condition  = FormatConditionEnum.Equal;
            f1.Value1     = "8";
            f1.ApplyToRow = true;
            DevExpress.XtraTreeList.StyleFormatConditions.StyleFormatCondition f2 = treeView.FormatConditions[1];
            f2.Condition  = FormatConditionEnum.Equal;
            f2.Value1     = "9";
            f2.ApplyToRow = true;
            DevExpress.XtraTreeList.StyleFormatConditions.StyleFormatCondition f3 = treeView.FormatConditions[2];
            f3.Condition  = FormatConditionEnum.Equal;
            f3.Value1     = "0";
            f3.ApplyToRow = true;

            treeView.BeginUnboundLoad();

            foreach (TreeListNode gpNode in treeView.Nodes)
            {
                gpNode.SetValue(0, 8);
                foreach (TreeListNode pNode in gpNode.Nodes)
                {
                    pNode.SetValue(0, 9);
                }
            }

            treeView.EndUnboundLoad();

            f1.Column = colLevel;
            f2.Column = colLevel;
            f3.Column = colLevel;

            colLevel.Visible = false;
        }
Beispiel #5
0
        private void ConfigTreeList(bool x = true)
        {
            if (x)
            {
                this.treeList1.Columns.AddRange(
                    new DevExpress.XtraTreeList.Columns.TreeListColumn[]
                {
                    this.colType        = this.createTypeColumn(),
                    this.colName        = this.createNameColumn(),
                    this.colDescription = this.createDescriptionColumn()
                }
                    );
            }
            TreeListColumnCollection columns = this.treeList1.Columns;

            {
                this.treeList1.PreviewFieldName = this.colDescription.FieldName;
                this.treeList1.OptionsView.AutoCalcPreviewLineCount = true;
                this.treeList1.OptionsView.AutoWidth      = true;
                this.treeList1.OptionsView.ShowPreview    = true;
                this.treeList1.OptionsView.ShowCheckBoxes = true;
                this.treeList1.OptionsBehavior.AllowBoundCheckBoxesInVirtualMode = true;
                this.treeList1.OptionsBehavior.AllowIndeterminateCheckState      = true;
                this.treeList1.OptionsBehavior.AllowRecursiveNodeChecking        = true;
                this.treeList1.OptionsBehavior.AllowExpandOnDblClick             = true;
            }
            this.treeList1.BeginUnboundLoad();
            {
                this.treeList1.DataSource = new object();
                //this.treeList1.RefreshDataSource();
            }
            this.treeList1.EndUnboundLoad();
            this.ConfigureTreeListUnboundDataHandles();
            //{
            //    this.treeList1.RestoreLayoutFromXml(@"D:\TEMP\SQLite\treeListLayout.xml");
            //    this.treeList1.ImportFromXml(@"D:\TEMP\SQLite\treeListData.xml");
            //}
        }
Beispiel #6
0
        public void SetColumn(TreeListColumnCollection columns)
        {
            foreach (TreeListColumn col in columns)
            {

                if (col.FieldName == "Org_ID")
                    col.Visible = false;

                if (col.FieldName == "OrgL_ID")
                    col.Visible = false;

                if (col.FieldName == "Sequence")
                    col.Visible = false;

                if (col.FieldName == "ParentID")
                    col.Visible = false;

                if (col.FieldName == "State")
                    col.Visible = false;

                if (col.FieldName == "OrgCode")
                {
                    col.Caption = "编号";
                    col.VisibleIndex = 0;
                }

                if (col.FieldName == "cnName")
                {
                    col.Caption = "中文名称";
                    col.VisibleIndex = 1;
                }

                if (col.FieldName == "cnFullName")
                {
                    col.Caption = "中文全名";
                    col.VisibleIndex = 2;
                }

                if (col.FieldName == "enName")
                {
                    col.Caption = "英文名称";
                    col.VisibleIndex = 3;
                }

                if (col.FieldName == "enFullName")
                {
                    col.Caption = "英文全名";
                    col.VisibleIndex = 4;
                }

                if (col.FieldName == "Postcode")
                {
                    col.Caption = "邮政编码";
                    col.VisibleIndex = 5;
                }

                if (col.FieldName == "Address")
                {
                    col.Caption = "地址";
                    col.VisibleIndex = 6;
                }

                if (col.FieldName == "Website")
                {
                    col.Caption = "网址";
                    col.VisibleIndex = 7;
                }

                if (col.FieldName == "Enabled")
                {
                    col.Caption = "启用";
                    col.VisibleIndex = 8;
                }

                if (col.FieldName == "Remark")
                {
                    col.Caption = "备注";
                    col.VisibleIndex = 9;
                }

                if (col.FieldName == "CityCode")
                {
                    col.Caption = "城市编码";
                    col.VisibleIndex = 10;
                }

                if (col.FieldName == "OurCompany")
                {
                    col.Caption = "公司概况";
                    col.VisibleIndex = 11;
                }

                if (col.FieldName == "RowVersion")
                {
                    col.Visible = false;
                }
            }
        }
Beispiel #7
0
 public virtual void DrawVerticalGridLines(TreeListColumnCollection columns, Graphics dc, Rectangle r, int hScrollOffset)
 {
     foreach (TreeListColumn col in columns.VisibleColumns)
     {
         int rightPos = col.CalculatedRect.Right - hScrollOffset;
         if (rightPos < 0)
             continue;
         Pen p = new Pen(columns.Owner.GridLineColour);
         dc.DrawLine(p, rightPos, r.Top, rightPos, r.Bottom);
         p.Dispose();
     }
 }
 public TreeListDataColumnInfo(TreeListColumnCollection columns)
 {
     this.columns = columns;
 }