public void loadDGVMem() { dgvMembers.RowTemplate.Height = 50; dgvMembers.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells); dgvMembers.AllowUserToAddRows = false; dgvMembers.EditMode = DataGridViewEditMode.EditProgrammatically; MEMBERs mem = new MEMBERs(); DataTable dt = new DataTable(); dt = mem.getAllMEMBERS(); dgvMembers.DataSource = dt; DataGridViewImageColumn pic = new DataGridViewImageColumn(); pic = (DataGridViewImageColumn)dgvMembers.Columns[3]; pic.ImageLayout = DataGridViewImageCellLayout.Zoom; //foreach (DataGridViewRow row in dgvMembers.Rows) //{ // if (row.Cells["note"].Value.ToString() == "Chờ duyệt") // { // row.DefaultCellStyle.BackColor = Color.Khaki; // } // else // { // row.DefaultCellStyle.BackColor = Color.MediumSeaGreen; // } //} }
string getMemName() { string memName = null; MEMBERs mem = new MEMBERs(); string memID = null; memID = dgvContracts.CurrentRow.Cells[1].Value.ToString(); DataTable dt = new DataTable(); dt = mem.getMemberbyID(memID); memName = dt.Rows[0][1].ToString() + " " + dt.Rows[0][2].ToString(); return memName; }
//Ham xu ly public void loadDGVMem() //Format lại cột BDate của Member (#FORMAT) { dgvMembers.RowTemplate.Height = 50; dgvMembers.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells); dgvMembers.AllowUserToAddRows = false; dgvMembers.EditMode = DataGridViewEditMode.EditProgrammatically; MEMBERs mem = new MEMBERs(); DataTable dt = new DataTable(); dt = mem.getAllMEMBERS(); dgvMembers.DataSource = dt; DataGridViewImageColumn pic = new DataGridViewImageColumn(); pic = (DataGridViewImageColumn)dgvMembers.Columns[3]; pic.ImageLayout = DataGridViewImageCellLayout.Zoom; }
private void txtSearchMembers_KeyUp(object sender, KeyEventArgs e) { MEMBERs mem = new MEMBERs(); dgvMembers.DataSource = mem.searchMember(txtSearchMembers.Text); }