Ok probably
been asked hundreds of times but the answer I found could not help me :(
I'm using Visual Studios 2005. I have a DataGrid in a WindowsApplication.
Basically when I click a cell I want to get what the cell contains and put it
in to a veritable. If you can help me
then pleas do kind of stuck….

OnClick DataGrid
logtorahul
lm4242
private void dataGridView1_CellClick( object sender, DataGridViewCellEventArgs e )
{
DataGridViewCell cell = dataGridView1.Rows[ e.RowIndex ].Cells[ e.ColumnIndex ];
MessageBox.Show( this, "Selected value is " + cell.Value );
}
If you want to get more information about the DataGridView you should read: Introducing a New Data Grid.
You can use the normall old DataGrid, but then you need to do a HitTest in the MouseUp event.