Esempio n. 1
0
        private void InitializeMainTable()
        {
            MainRDGV = new RDataGridView <MainTableModel>();

            ((ISupportInitialize)MainRDGV).BeginInit();
            MainRDGV.SuspendLayout();
            MainRDGV.Location          = new Point(10, 35);
            MainRDGV.Margin            = new Padding(4, 3, 4, 3);
            MainRDGV.Name              = "MainRDGV";
            MainRDGV.RowHeadersVisible = false;
            MainRDGV.SelectionMode     = DataGridViewSelectionMode.CellSelect;
            MainRDGV.Size              = new Size(1660, 627);
            MainRDGV.TabIndex          = 0;

            MainRDGV.AllowUserToAddRows    = false;
            MainRDGV.AllowUserToDeleteRows = false;
            MainRDGV.AllowUserToResizeRows = false;
            MainRDGV.AutoSizeColumnsMode   = DataGridViewAutoSizeColumnsMode.Fill;
            MainRDGV.BackgroundColor       = Color.White;
            MainRDGV.BorderStyle           = BorderStyle.None;
            MainRDGV.ClipboardCopyMode     = DataGridViewClipboardCopyMode.EnableAlwaysIncludeHeaderText;
            MainRDGV.Dock = DockStyle.Fill;

            var rdgvCellStyle1 = new DataGridViewCellStyle();

            rdgvCellStyle1.Alignment               = DataGridViewContentAlignment.MiddleLeft;
            rdgvCellStyle1.BackColor               = SystemColors.Control;
            rdgvCellStyle1.Font                    = new Font("Microsoft Sans Serif", 11.25F, FontStyle.Bold, GraphicsUnit.Point);
            rdgvCellStyle1.ForeColor               = SystemColors.WindowText;
            rdgvCellStyle1.SelectionBackColor      = SystemColors.Highlight;
            rdgvCellStyle1.SelectionForeColor      = SystemColors.HighlightText;
            rdgvCellStyle1.WrapMode                = DataGridViewTriState.True;
            MainRDGV.ColumnHeadersDefaultCellStyle = rdgvCellStyle1;
            MainRDGV.ColumnHeadersHeightSizeMode   = DataGridViewColumnHeadersHeightSizeMode.AutoSize;

            var rdgvCellStyle2 = new DataGridViewCellStyle();

            rdgvCellStyle2.Alignment          = DataGridViewContentAlignment.MiddleLeft;
            rdgvCellStyle2.BackColor          = SystemColors.Window;
            rdgvCellStyle2.Font               = new Font("Microsoft Sans Serif", 11.25F, FontStyle.Regular, GraphicsUnit.Point);
            rdgvCellStyle2.ForeColor          = SystemColors.ControlText;
            rdgvCellStyle2.SelectionBackColor = SystemColors.Highlight;
            rdgvCellStyle2.SelectionForeColor = SystemColors.HighlightText;
            rdgvCellStyle2.WrapMode           = DataGridViewTriState.False;
            MainRDGV.DefaultCellStyle         = rdgvCellStyle2;

            ((ISupportInitialize)MainRDGV).EndInit();
            MainRDGV.ResumeLayout(false);
        }
Esempio n. 2
0
        public RDataGridViewTest()
        {
            _rdgv = new RDataGridView <Irradiation>();

            _rdgv.CurrentDbSet.Where(ir => ir.LoadNumber == 122).ToArray();
            _rdgv.DataSource = _rdgv.CurrentDbSet.Local.ToBindingList();

            #region will_not_populate_dgv_wo_this

            using (var g = _rdgv.CreateGraphics()) { }
            using (var f = new Form())
            {
                f.Controls.Add(_rdgv);
                f.Controls.Remove(_rdgv);
            }

            #endregion
        }