0

I want to read the data in a specific cell of a datagrid, or be able to assign the cell value to a variable; Important note: I am new to C#, I spend ours looking, Now I don’t have more time for research although the question is kind of idiotic for someone. Sorry If I am violating any rule of this site, but I ran out of time and need an answer asp.

engel
  • 13
  • 5
  • Possible duplicate of [Reading data from DataGridView in C#](http://stackoverflow.com/questions/6487839/reading-data-from-datagridview-in-c-sharp) – Ňɏssa Pøngjǣrdenlarp Aug 10 '16 at 22:49
  • Perhaps [this](https://stackoverflow.com/questions/6487839/reading-data-from-datagridview-in-c-sharp) is what you're looking for? – David Silva Aug 10 '16 at 23:13

1 Answers1

0

Try this

YOu can get the value like this :

string str=Gridview_name.Rows[row_index]["Column_name"].ToString();

Assigning value to a specific cell can do similar ways :

Gridview_name.Rows[row_index]["Column_name"] = value;

For more reference here

lakshmi prakasan
  • 330
  • 4
  • 12