public void RefreshTable(Library.Library results) { BindingSource source = new BindingSource(); source.DataSource = results; dataGridView1.DataSource = source; }
private void topMenuOpen_Click(object sender, EventArgs e) { OpenFileDialog opener = new OpenFileDialog(); if (opener.ShowDialog() == DialogResult.OK) { Stream file = File.Open(opener.FileName, FileMode.Open); BinaryFormatter bFormatter = new BinaryFormatter(); Library.Library lib = (Library.Library)bFormatter.Deserialize(file); file.Close(); Program.BookLibrary = lib; RefreshTable(); Enable(); } }