Use the Item property (which is the indexer in C#) to retrieve the value of
any cell.
Coordinates of the currently selected cell can indeed be obtained as
suggested by AirPete.
--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://www.x-unity.net/teststudio.aspx
Bring the power of unit testing to VS .NET IDE
"Dave Petersen" <da*******************@carlson.com> wrote in message
news:uW**************@tk2msftngp13.phx.gbl...
In my C# winforms datagrid, how do I get the value of the selected cell?
In asp.net I can use:
dataGrid1.SelectedIndex
but SelectedIndex is not available in windows forms apps. HitTestInfo
will return the cell number and row number, but I need to get the actual
contents of the cell.
Thanks,
Dave