protected override void btnAdd_Click(object sender, EventArgs e) { FrmCategoryEdit frm = new FrmCategoryEdit(); frm.ShowDialog(); refresh(); }
protected override void button2_Click(object sender, EventArgs e) { Categories cat = (Categories)dataGridView1.SelectedRows[0].DataBoundItem; FrmCategoryEdit frm = new FrmCategoryEdit(cat); frm.ShowDialog(); refresh(); }
protected override void btnEdit_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count <= 0) { MessageBox.Show("select row to Update"); return; } Categories ctg = (Categories)dataGridView1.SelectedRows[0].DataBoundItem; FrmCategoryEdit frm = new FrmCategoryEdit(ctg); frm.ShowDialog(); refresh(); }
protected override void button2_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count <= 0) { MessageBox.Show("Select row"); return; } Categories entity = (Categories)dataGridView1.SelectedRows[0].DataBoundItem; FrmCategoryEdit frm = new FrmCategoryEdit(entity); frm.ShowDialog(); refresh(); }