Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
C#
  int rowindex = Convert.ToInt32(e.RowIndex);
string column_name = GridView4.Rows[rowindex].Cells[2].Text;
Posted
Updated 24-Dec-12 22:30pm
v2

hi,

After editing when you click on update button read all the textbox values at that time.
 
Share this answer
 
Comments
Member 9644686 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.
HI,

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


Thanks
 
Share this answer
 
v2
Comments
Member 9644686 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.
[no name] 25-Dec-12 7:53am    
Check out the links that I had Updated in my solution.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900