Ejemplo n.º 1
0
        private void splitter_SplitterMoved(object sender, int newLoc)
        {
            CustomSplitter splitter = (CustomSplitter)sender;
            Control        ctrl     = (Control)splitter.Tag;
            VersatileDataGridColumnStyle columnStyle = (VersatileDataGridColumnStyle)ctrl.Tag;

            columnStyle.Width += splitter.DraggedTotal;
        }
Ejemplo n.º 2
0
        public void SetupColumns()
        {
//			for (int i = this.Controls.Count-1; i >= 0; i--)
//			{
//				Control ctrl = this.Controls[i];
//				if (ctrl != this.listView1)
//					this.Controls.Remove(ctrl);
//			}
//			this.listView1.Columns.Clear();
//			this.listView1.Visible = false;

            this.Controls.Clear();

            for (int x = 0; x < this.slColumnStyles.Count; x++)
            {
                VersatileDataGridColumnStyle columnStyle = this.GetColumnStyle(x);
                //					TextBox headerCtrl = new TextBox();
                //					headerCtrl.BorderStyle = BorderStyle.None;
                //					headerCtrl.Enabled = false;
                //					headerCtrl.BackColor = Color.White;


                ColumnHeader colHeader = new ColumnHeader();
                colHeader.Text  = columnStyle.ColumnName;
                colHeader.Width = columnStyle.Width;
//				this.listView1.Columns.Add(colHeader);


                System.Windows.Forms.Button headerCtrl = new System.Windows.Forms.Button();
                headerCtrl.Text      = columnStyle.ColumnName;
                headerCtrl.FlatStyle = FlatStyle.Popup;
                headerCtrl.Font      = new Font("Verdana", 6.75f);
                headerCtrl.BackColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.Control);

                headerCtrl.Tag    = columnStyle;
                headerCtrl.Click += new EventHandler(headerCtrl_Click);
                this.Controls.Add(headerCtrl);                 //this.panelSubHeaders
                //headerCtrl.Visible = false;

                CustomSplitter splitter = new CustomSplitter();
                splitter.Width = this.SplitterWidth;
                splitter.Tag   = headerCtrl;
                //					splitter.SplitterMoving+=new Endogine.Editors.CustomSplitter.SplitterEventHandler(splitter_SplitterMoving);
                splitter.SplitterMoved += new Endogine.Editors.CustomSplitter.SplitterEventHandler(splitter_SplitterMoved);
                this.Controls.Add(splitter);                 //this.panelSubHeaders
            }
            this.RecalcColumnLeftRights();
        }
Ejemplo n.º 3
0
        public void SetupColumns()
        {
            //			for (int i = this.Controls.Count-1; i >= 0; i--)
            //			{
            //				Control ctrl = this.Controls[i];
            //				if (ctrl != this.listView1)
            //					this.Controls.Remove(ctrl);
            //			}
            //			this.listView1.Columns.Clear();
            //			this.listView1.Visible = false;

            this.Controls.Clear();

            for (int x = 0; x < this.slColumnStyles.Count; x++)
            {
                VersatileDataGridColumnStyle columnStyle = this.GetColumnStyle(x);
                //					TextBox headerCtrl = new TextBox();
                //					headerCtrl.BorderStyle = BorderStyle.None;
                //					headerCtrl.Enabled = false;
                //					headerCtrl.BackColor = Color.White;

                ColumnHeader colHeader = new ColumnHeader();
                colHeader.Text = columnStyle.ColumnName;
                colHeader.Width = columnStyle.Width;
            //				this.listView1.Columns.Add(colHeader);

                System.Windows.Forms.Button headerCtrl = new System.Windows.Forms.Button();
                headerCtrl.Text = columnStyle.ColumnName;
                headerCtrl.FlatStyle = FlatStyle.Popup;
                headerCtrl.Font = new Font("Verdana", 6.75f);
                headerCtrl.BackColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.Control);

                headerCtrl.Tag = columnStyle;
                headerCtrl.Click+=new EventHandler(headerCtrl_Click);
                this.Controls.Add(headerCtrl); //this.panelSubHeaders
                //headerCtrl.Visible = false;

                CustomSplitter splitter = new CustomSplitter();
                splitter.Width = this.SplitterWidth;
                splitter.Tag = headerCtrl;
                //					splitter.SplitterMoving+=new Endogine.Editors.CustomSplitter.SplitterEventHandler(splitter_SplitterMoving);
                splitter.SplitterMoved+=new Endogine.Editors.CustomSplitter.SplitterEventHandler(splitter_SplitterMoved);
                this.Controls.Add(splitter); //this.panelSubHeaders
            }
            this.RecalcColumnLeftRights();
        }