0

Hi all,

I am a beginner in C# and am exploring dataGridView currently ,am stuck at a point would be amazing if i could get a professional insight on the below problem.

I want to capture the data from the cell of the dataGridView.Basically i want the value of the particular cell selected .It would be much appreciated if the funda behing it could also be explained.

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by ddanbe
0
int rowindex, cellindex
rowindex = 0 //rowindex is the vertical value
cellindex = 0 //cellindex is the horizontal value
string CellContent = datagridview.rows(rowindex).cell(cellindex).value.tostring();

when using an event such as a cell content changed, will give the rowindex and cellindex these can then be used as shown above

usually would look like:

string CellContent = datagridview.rows(e.rowindex).cell(e.cellindex).value.tostring();[/
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.