Click here to Skip to main content
13,596,556 members
Rate this:
Please Sign up or sign in to vote.
See more:
i want to retrieve the values inside the row in gridview.
but i enable the autogenerated edit button and autogenerated column because i am selecting the database and table in the dropdownlist and then i open the table through the gridview.For editing i will clicks the edit button it will transfer all its values to the textbox after editing, i want that all cell values please tell me how can i get ,,,,
i used this but it returns null
  int rowindex = Convert.ToInt32(e.RowIndex);
string column_name = GridView4.Rows[rowindex].Cells[2].Text;
Posted 24-Dec-12 22:29pm
Updated 24-Dec-12 22:30pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1


After editing when you click on update button read all the textbox values at that time.
25-Dec-12 5:29am
text box means not the outside textbox .it is in the gridview itself that means that you add autogenerated edit button then click edit it will automatically create a textbox in the gridview that all values are filled in this txtbox. i don't know the id of that txtbox.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2


You can do this by assigning the cell values into hidden fields while binding the data to the grid. And when you are trying to access the value on the edit button click you can get the values from the hidden fields easily. Try like this.

how to edit and update row values in grid view?
edit,update row in gridview

25-Dec-12 6:15am
boss i want to do update on database....
i can't please if u have any snippets please i will refer and i will try to do that.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web01 | 2.8.180621.3 | Last Updated 25 Dec 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100