Monday 29 July 2013

Edit in Datagridview

try
            {
                int id = Convert.ToInt32(dataGridView1.CurrentRow.Index.ToString());
                cid = Convert.ToInt32(dataGridView1.Rows[id].Cells[0].Value.ToString());
                cname = dataGridView1.Rows[id].Cells[1].Value.ToString();
                cadd = dataGridView1.Rows[id].Cells[2].Value.ToString();
                cont = dataGridView1.Rows[id].Cells[3].Value.ToString();
                Edit_Customer ob = new Edit_Customer();
                ob.Show();
                this.Close();
               
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

No comments:

Post a Comment