Gridview strangeness

G

Guest

Is there any reason why in the following code the text value of the cells for
the row that is being updated is always without fail blank ? All the other
rows in the grid view show the data that they have in them. What ever row has
been edited however shows blanks, even though the data is displaying in the
gridview.

protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs
e)
{
for (int x = 0; x < GridView1.Rows.Count; x++)
{
string val = GridView1.Rows[x].Cells[0].Text + " " +
GridView1.Rows[x].Cells[1].Text + " " +
GridView1.Rows[x].Cells[2].Text + " " +
GridView1.Rows[x].Cells[3].Text + " " +
GridView1.Rows[x].Cells[4].Text;

Response.Write(val);
Response.Write("<br>");
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,165
Latest member
JavierBrak
Top