Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
protected void updating(object sender, GridViewUpdateEventArgs e)
      {
           TextBox1.Text = gvShowProducts.Rows[e.RowIndex].Cells[2].Text
      }


But its showing an empty text box???

please help..
Posted
Updated 9-Jun-11 21:27pm
v2
Comments
RakeshMeena 10-Jun-11 4:14am    
If your query is answered, please mark it!

Suggest you retrieve the value from e.NewValues or e.OldValues (based on your requirement) properties. These are dictionary collections which will give you the cell values for that row.
Further suggest you to use the debugging feature provided by your IDE.
 
Share this answer
 
Comments
varunmohan 10-Jun-11 3:40am    
Thanks rakeshmeena..............its working..........
varunmohan 10-Jun-11 3:42am    
can u please expalin why its not returning value when the code is like this TextBox1.Text = gvShowProducts.Rows[e.RowIndex].Cells[2].Text
RakeshMeena 10-Jun-11 4:09am    
As far as I know the text value will be set on a control which is part of cell ("gvShowProducts.Rows[e.RowIndex].Cells[2]"), though a lot depends on the markup (HTML) you've written. If you debug you can observe this.
You should also try the link provided by Monjurul.
varunmohan 10-Jun-11 10:22am    
thanks.......

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