private void GetFocusedRowData(int index) { if (index >= 0 && ScreenView.RowCount > 0) { ScreenView.FocusedRowHandle = index; btnSave.Enabled = false; btnAddNew.Enabled = btnDelete.Enabled = btnModify.Enabled = true; txtScreenCode.Text = ScreenView.GetRowCellValue(index, ScreenManager.ScreenDetails.ScreenCode.ToString()).ToString(); txtScreenName.Text = ScreenView.GetRowCellValue(index, ScreenManager.ScreenDetails.ScreenName.ToString()).ToString(); DALLayer.Screen s = new ScreenManager().Get(int.Parse(txtScreenCode.Text)); for (int i = 0; i < dgvPermissions.Rows.Count; i++) { foreach (PermissionsInScreen p in s.PermissionsInScreen) { dgvPermissions.Rows[i].Cells[check.Name].Value = p.Permission_Code == int.Parse(dgvPermissions.Rows[i].Cells[PerCode.Name].Value.ToString()) ? true : dgvPermissions.Rows[i].Cells[check.Name].Value; } } } }