private void SearchInfoForm_Load(object sender, EventArgs e) { dataGridView1.AutoGenerateColumns = false; dataGridView1.Font = new Font(new FontFamily("宋体"), 11); bindingSource1.DataSource = Heart.GetDataSource().Tables[0]; dataGridView1.DataSource = bindingNavigator1.BindingSource = bindingSource1; }
private void button3_Click(object sender, EventArgs e) { if (!dataGridView1.Visible) { dataGridView1.Visible = true; dataGridView1.AutoGenerateColumns = false; dataGridView1.Font = new Font(new FontFamily("宋体"), 11); dataGridView1.DataSource = Heart.GetDataSource().Tables[0].DefaultView; button3.Text = "点击关闭"; } else { dataGridView1.Visible = false; button3.Text = "全部信息"; } }