Mfwamba Tshimanga

Mfwamba Tshimanga

  • NA
  • 155
  • 45.8k

Data from dataGrid doesnt show in my textboxs. Why?

May 22 2014 11:38 AM
Hi!
 
My codes sound well. But I don't understand why when I scroll updown with my arrow from keyboard. Its doesnt show up on my textbox? 
 
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
SqlConnection con = new SqlConnection("Data Source=localhost\\sqlexpress;Initial Catalog=master;Integrated Security=True");
if (e.RowIndex >= 0)
{
DataGridViewRow row = this.dataGridView1.Rows[e.RowIndex];
codidoDataTempoRealFactu.Text = row.Cells["codigo"].Value.ToString();
designacaoDataTempoRealFactu.Text = row.Cells["designacao"].Value.ToString();
quantidadeDataTempoRealFactu.Text = row.Cells["quantidade"].Value.ToString();
precocompraDataTempoRealFactu.Text = row.Cells["preco_compra"].Value.ToString();
valorDataTempoRealFactu.Text = row.Cells["valor"].Value.ToString();
totalDataTempoRealFactu.Text = row.Cells["total"].Value.ToString();
}
}
}
}
 

Answers (2)