tente isso:
private void dgvProdutos_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
int row = dgvProdutos.CurrentCell.RowIndex;
if (dgvProdutos[0, row].Value != null)
{
txtCodigo.Text = dgvProdutos[0, row].Value.ToString();
txtProdutos.Text = dgvProdutos[1, row].Value.ToString();
}
}
Thyago Gonçalves