Get data of a clicked DataGrid Row?
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