but I need to modify the last piece to edit the record that I will
supply the record id.
http://asptutorials.net/ASP/gridview...dit-blank-row/
I am using stored proc to insert a new record and returning the id.
Now I can get the id in my asp.net (c$) environment. I added a label
and I was able to populated the label with the newly added record's
id.
I would like to use this new id to following code to edit. Also, my
gridview does not refresh after adding the new record
(gridview2.databind() not doing what it supposed to).
Instead of getting empty row, i would like to get a row by record id
and put it in edit mode.
Expand|Select|Wrap|Line Numbers
- int totalrows = GridView1.Rows.Count;
- for (int r = 0; r < totalrows; r++)
- {
- if (GridVIew1.DataKeys[r].Values[1].ToString() == "")
- {
- GridVIew1.EditIndex = r;
- break;
- }
- }