I need to determine the value of a cell as the user clicks it. I am using C# VS2010 RC. For the life of me, I just can't seem to find out how.
Any help would be greatly appreciated
int index = this.dgrYourGrid.SelectedIndex; //Datagrid Selected Row Number
MessageBox.Show("Row: " + index.ToString(), "Index"); //Show curent Row Number
string colname = dgrYourGrid.CurrentColumn.Header.ToString(); //Column Name
MessageBox.Show("Columnname " + colname, "Column"); //Show Column Name
object value = (this.dgrYourGrid.Items[index] as DataRowView)[colname]; //read Selectet Cell Content
MessageBox.Show("the value is " + value.ToString(), "Result"); //Show Result