private void ViewTile_Click(object sender, EventArgs e) { ViewTile.color = Color.FromArgb(242, 242, 242); InsertTile.color = Color.Wheat; DeleteTile.color = Color.Wheat; UpdateTile.color = Color.Wheat; SelectTile.color = Color.Wheat; HideTile.color = Color.Wheat; idGB.Visible = false; grid.Visible = true; detailsGB.Visible = true; UpdateBtn.Visible = false; DeleteBtn.Visible = false; InsertBtn.Visible = false; ClearBtn.Visible = false; var dataSource = _studentService.GetStudentsDataTable(); if (dataSource.Rows.Count == 0) { MessageBox.Show("This table currently contains no record!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } grid.DataSource = dataSource; }