>Hi All,
>
>I have an ASPX page with the GridView control. The grid control includes the CommandField in order to allow user to be redirected to another page for editing purposes. The RowCommand event captures the row selected and stores its primary key into the Session variable.
>
>Now I also need to capture the Next and Previous (if exists) row's primay key field. How would I go about capturing this data?
>
Try :
GridView1.Rows[GridView1.SelectedRow.RowIndex-1]
to get the previous, similar to get the next. But you'd need to check the RowIndex against the row count first to make sure the next/previous would be valid....