private void frmCompanyRecord_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide();
            frmSubCategory frm = new frmSubCategory();

            frm.Show();
        }
        private void dataGridView1_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            DataGridViewRow dr = dataGridView1.SelectedRows[0];

            this.Hide();
            frmSubCategory frm = new frmSubCategory();

            // or simply use column name instead of index
            //dr.Cells["id"].Value.ToString();
            frm.Show();
            frm.txtSubCategoryID.Text = dr.Cells[0].Value.ToString();
            frm.txtSubCategory.Text   = dr.Cells[1].Value.ToString();
            frm.txtCategoryID.Text    = dr.Cells[2].Value.ToString();
            frm.cmbCategory.Text      = dr.Cells[3].Value.ToString();
            frm.btnDelete.Enabled     = true;
            frm.btnUpdate.Enabled     = true;
            frm.txtSubCategory.Focus();
            frm.btnSave.Enabled = false;
        }
示例#3
0
        private void companyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmSubCategory frm = new frmSubCategory();

            frm.Show();
        }