private void SetDisplay() { if (skinComboBox_PfCustomer.SelectedValue == null && String.IsNullOrEmpty(this.skinTextBox_costumeID.Text)) {//正常 if (view != null) { this.skinSplitContainer1.Panel1.Controls.Remove(view); view.Dispose(); dataGridViewPagingSumCtrl1.Dispose(); } // view.SendToBack(); dataGridView1.BringToFront(); //view.Dispose(); dataGridViewPagingSumCtrl.RemoveNotShowInColumnSettings(pfCustomerNameDataGridViewTextBoxColumn); dataGridViewPagingSumCtrl.AppendNotShowInColumnSettings(costumeIDDataGridViewTextBoxColumn, costumeNameDataGridViewTextBoxColumn, colorNameDataGridViewTextBoxColumn, sizeNameDataGridViewTextBoxColumn); } else if (!String.IsNullOrEmpty(this.skinTextBox_costumeID.Text) && skinComboBox_PfCustomer.SelectedValue == null) { view?.BringToFront(); // dataGridView1.SendToBack(); } else if (!String.IsNullOrEmpty(this.skinTextBox_costumeID.Text) && skinComboBox_PfCustomer.SelectedValue != null) { if (view != null) { this.skinSplitContainer1.Panel1.Controls.Remove(view); view.Dispose(); dataGridViewPagingSumCtrl1.Dispose(); } dataGridView1.BringToFront(); //dataGridView1.Visible = true; //view.Visible = false; //单独款号的时候 dataGridViewPagingSumCtrl.AppendNotShowInColumnSettings(pfCustomerNameDataGridViewTextBoxColumn); dataGridViewPagingSumCtrl.RemoveNotShowInColumnSettings(costumeIDDataGridViewTextBoxColumn, costumeNameDataGridViewTextBoxColumn, colorNameDataGridViewTextBoxColumn, sizeNameDataGridViewTextBoxColumn); } else { if (view != null) { this.skinSplitContainer1.Panel1.Controls.Remove(view); view.Dispose(); dataGridViewPagingSumCtrl1.Dispose(); } // view.Dispose(); //dataGridView1.Visible = true; dataGridView1.BringToFront(); // view.Visible = false; // view.SendToBack(); //款号和客户都有的时候 dataGridViewPagingSumCtrl.AppendNotShowInColumnSettings(pfCustomerNameDataGridViewTextBoxColumn, colorNameDataGridViewTextBoxColumn, sizeNameDataGridViewTextBoxColumn); dataGridViewPagingSumCtrl.RemoveNotShowInColumnSettings(costumeIDDataGridViewTextBoxColumn, costumeNameDataGridViewTextBoxColumn); } }