Example #1
0
        private void gridItensBusca_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            int    id;
            string nome;
            double valorvenda;

            string [] valores = new string[3];
            gridItensBusca.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            if (gridItensBusca.SelectedRows.Count >= 0)
            {
                DataGridViewRow row = gridItensBusca.SelectedRows[0];
                valores[0] = row.Cells[0].Value.ToString();
                valores[1] = row.Cells[1].Value.ToString();
                valores[2] = row.Cells[2].Value.ToString();
            }
            id         = Convert.ToInt32(valores[0]);
            nome       = valores[1];
            valorvenda = Convert.ToDouble(valores[2]);
            frmAtualizar.atualiza(id, nome, valorvenda);
            this.Dispose();
        }