private void bt_LoginUser_Click(object sender, EventArgs e) { bt_Product.BackColor = Color.LightGreen; bt_LoginUser.BackColor = Color.Yellow; bt_ProdType.BackColor = Color.LightGreen; bt_RFIDTags.BackColor = Color.LightGreen; bt_Tax.BackColor = Color.DarkOrange; bt_SysConfig.BackColor = Color.Orchid; DataAccessPOS dbPOS = new DataAccessPOS(); loginUsers = dbPOS.Get_All_LoginUsers(); isProduct = false; isLoginUser = true; isPType = false; isRFIDTag = false; isSysConfig = false; isTax = false; isStation = false; isPromotion = false; dgvData_LoginUser_Initialize(); if (loginUsers.Count > 0) { foreach (var loginUser in loginUsers) { this.dgvData.Rows.Add(new String[] { loginUser.Id.ToString(), loginUser.FirstName, loginUser.LastName, loginUser.PassWord, loginUser.Grade }); if (Convert.ToInt32(loginUser.Grade) < 2) { this.dgvData.Rows[dgvData.RowCount - 2].Cells[4].Style.BackColor = Color.Green; } this.dgvData.FirstDisplayedScrollingRowIndex = dgvData.RowCount - 1; } } }