private void DisplayAllRecords() { _dataTable = _stockInManager.DisplayAllRecords(); dataGridViewStockInAllRecord.DataSource = _dataTable; if (_dataTable.Rows.Count == 0) { MessageBox.Show("No any records"); } foreach (DataGridViewRow row in dataGridViewStockInAllRecord.Rows) { row.Cells["SL"].Value = (row.Index + 1).ToString(); row.Cells["Action"].Value = Convert.ToString("Edit"); } }