private void DataViewer_Load(object sender, EventArgs e) { this.button2.DialogResult = DialogResult.Cancel; base.AutoScaleMode = AutoScaleMode.Font; dataGridView1.DoubleBuffered(true); dataGridView2.DoubleBuffered(true); this.label1.Text = this.Title; this.label1.BackColor = this.BKColor; MainForm.createColumns(this.DTable, this.dataGridView1); MainForm.createColumns(this.DTable, this.dataGridView2); this.groupBox1.Hide(); this.groupBox2.Hide(); if (this.ModifiedTable != null) { this.groupBox1.Show(); this.modified_bs.DataSource = this.ModifiedTable.DefaultView; this.dataGridView1.DataSource = this.modified_bs; } if (this.AddedTable != null) { this.groupBox2.Show(); this.added_bs.DataSource = this.AddedTable.DefaultView; this.dataGridView2.DataSource = this.added_bs; } if (this.ModifiedTable == null) { this.SplitPercent = 0f; } else if (this.AddedTable == null) { this.SplitPercent = 1f; } else { if (this.ModifiedTable == null && this.AddedTable == null) { throw new Exception("all the tables are null."); } this.SplitPercent = 0.5f; } this.button1.Enabled = this.OKButtonEnabled; }