timon 0

timon 0

  • NA
  • 1
  • 0

Get data of a clicked DataGrid Row?

Mar 1 2004 7:12 AM
Hi, i need some help. I want to do the following: I have a DataSet and displayed a DataTable with a DataGrid. If the user clicks on a row of the DataSet, I want to get a cell of this clicked row (for example the ID of the clicked dataitem). private void dataGrid1_Click(object sender, System.EventArgs e) { textBox1.Text = dataGrid1[dataGrid1.CurrentRowIndex,0].ToString(); } This works, but the row must be selected! But I want to get the data, if a row is clicked (not selected). How can I do that? Thanx for your help. Timon