Link to home
Start Free TrialLog in
Avatar of cdX
cdX

asked on

Switch last gridview row to EditMode

I have code to insert a row into a gridview bound by a SqlDataSource and it prepopulates values.  How do I reference the inserted row (the last row of the gridview) and then switch that row to EditMode?

GridView1 is the name

Using VS2008Team, ASP.NET 3.5, SQL Server 2008 Ent

Thanks in advance!
ASKER CERTIFIED SOLUTION
Avatar of princeatapi
princeatapi
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cdX
cdX

ASKER

I used a combination of both of your comments to come up with the solution.  Thanks!
--INSERT COMMAND Code here--
GridView1.DataBind()
Dim LastRowIndx As Integer
LastRowIndx = GridView1.Rows.Count - 1
GridView1.EditIndex = LastRowIndx

Open in new window

Avatar of cdX

ASKER

The fact that I asked two questions actually, and one was solved for each.