private void DataGridView1_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { try { this.Hide(); FrmHostel_info frm = new FrmHostel_info(); frm.Show(); DataGridViewRow dr = DataGridView1.SelectedRows[0]; frm.txtID.Text = dr.Cells[0].Value.ToString(); frm.txtHostelName.Text = dr.Cells[1].Value.ToString(); frm.txtAddress.Text = dr.Cells[2].Value.ToString(); frm.txtPhoneNo.Text = dr.Cells[3].Value.ToString(); frm.txtManagedBy.Text = dr.Cells[4].Value.ToString(); frm.txtContactNo.Text = dr.Cells[5].Value.ToString(); frm.txtHostelFees.Text = dr.Cells[6].Value.ToString(); frm.lblUserType.Text = lblUserType.Text; frm.lblUser.Text = lblUser.Text; frm.btnUpdate_record.Enabled = true; frm.btnDelete.Enabled = true; frm.btnSave.Enabled = false; //ye hide ho jaye kyu ki grid view se data laye he update k liye save ke lie nhi } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void hostelEntryToolStripMenuItem_Click(object sender, EventArgs e) { this.Hide(); FrmHostel_info frm = new FrmHostel_info(); frm.lblUserType.Text = UserType.Text; frm.lblUser.Text = User.Text; frm.Show(); }
private void FrmHostelinfoRecord_FormClosing(object sender, FormClosingEventArgs e) { this.Hide(); FrmHostel_info frm = new FrmHostel_info(); frm.lblUserType.Text = lblUserType.Text; frm.lblUser.Text = lblUser.Text; frm.Show(); }