public void SaveBuju() { Dgvfuzhu.SaveDataGridViewStyle(this.Name, dataGridView1); Dgvfuzhu.SaveDataGridViewStyle(this.Name, dataGridView2); Dgvfuzhu.SaveDataGridViewStyle(this.Name, dataGridView3); MessageBox.Show("布局保存成功!"); }
public void DelBuju() { Dgvfuzhu.deleteDataGridViewStyle(this.Name, dataGridView1); Dgvfuzhu.deleteDataGridViewStyle(this.Name, dataGridView2); //Dgvfuzhu.BindReadDataGridViewStyle(this.Name, dataGridView1); MessageBox.Show("请关掉界面重新打开,恢复初始布局!"); }
private void UserControl1_Load(object sender, EventArgs e) { try { dataGridView2.AutoGenerateColumns = false; dataGridView1.AutoGenerateColumns = false; dataGridView3.AutoGenerateColumns = false; string sql = "select 0 as xz,* from zdy_lk_xunjia where byanfa = 1 and cyanfazt = '已提交' "; dtXunjia = DbHelper.ExecuteTable(sql); dataGridView1.DataSource = dtXunjia; comboBox1.Text = "已提交"; sql = "select cvalue from zdy_lk_para where lx = '101'"; cFtp = DbHelper.GetDbString(DbHelper.ExecuteScalar(sql)); Dgvfuzhu.BindReadDataGridViewStyle(this.Name, dataGridView1); // 初始化布局 Dgvfuzhu.BindReadDataGridViewStyle(this.Name, dataGridView2); // 初始化布局 //MessageBox.Show(cFtp); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void UserControl1_Load(object sender, EventArgs e) { dataGridView2.AutoGenerateColumns = false; dataGridView1.AutoGenerateColumns = false; Dgvfuzhu.BindReadDataGridViewStyle(this.Name, dataGridView1); // 初始化布局 Dgvfuzhu.BindReadDataGridViewStyle(this.Name, dataGridView2); // 初始化布局 string sql = @"select 0 as xz,[id] ,[xmbm] ,[cinvcode] ,[cinvaddcode] ,[cinvname],cEnglishname ,[cinvstd] ,[cqty1] ,[cqty2] ,[cqty3] ,[cqty4] ,[cqty5] ,[cmemo1] ,[czt] ,[cmaker] ,[ddate] ,[xunjiaid] ,[dmaketime] ,[dmodifytime] ,[bimportant] ,[burgent] ,[zdxjr] ,[fpxjr] ,[cztgbq] ,[dclosetime] ,[yid] ,[fpxjrxm] ,[cpersoncode] ,[cdefine1] ,[lx] ,[byanfa] ,[cyanfazt] ,[bself] ,[bsup] ,[bkucun] ,[cEnglishname] from zdy_lk_xunjia where czt = '已提交' and fpxjr = '" + canshu.userName + "'"; dtXunjia = DbHelper.ExecuteTable(sql); dataGridView1.DataSource = dtXunjia; comboBox1.Text = "已提交"; txtcgy.Text = canshu.userName; if (canshu.cQx == "1" || canshu.cQx == "2" || canshu.userName == "demo") { dataGridView1.Columns["fpxjr"].Visible = true; } }