private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { search = false; errorProvider1.Clear(); msg_lbl.Text = ""; msg_img.Image = InfoMate_Plus.Properties.Resources.empty_vista; if (dataGridView1.Rows.Count > 0) { Brand_ID = Convert.ToInt32(dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["ID"].Value); Brand_textBox1.Text = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["Brand"].Value.ToString(); string typ = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["Type"].Value.ToString(); string mak = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["Make"].Value.ToString(); SelectMake(mak); SelectType(typ); isedit = true; current = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Index; PositionItem.Text = " " + (current + 1).ToString(); } } catch (Exception) { MessageBox.Show("Exception occured..", "Exception", MessageBoxButtons.OK, MessageBoxIcon.Hand); } } private void SelectMake(string mak) { try { msg_lbl.Text = Make_comboBox.Items.Count.ToString(); int sel = Make_comboBox.Items.IndexOf(mak); Make_comboBox.SelectedItem = Make_comboBox.Items[sel]; } catch (Exception ex) { MessageBox.Show("Exception occured.." + ex, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Hand); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)