Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting Edit Mode in Gridview 1

Status
Not open for further replies.

JLizOB

Programmer
Dec 5, 2007
45
CA
Hi I have a gridview and below the gridview a user can add a new entry into the database. The Gridview is then rebound so the new entry is added to the Gridview. When I run my insert statement I am also returning the scope identity with the Select Scope_Identity() statement and a cmd.executescalar(). I was wondering how I could put the Gridview into edit mode based on the return value of the Scope Identity, which is the primary key of the table?
 
you mean you want to set the grid in edit mode for the record just entered? loop through the gridview.datakeys when the id = datakeys[x] use the index to set the gridview.editindex before binding the grid.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top