Hello there,
I have an asp.net 2.0 web app that uses gridview and formview. When a user
selects an item in the gridview the formview appears to show the detail.
This works quite well. However, I'd also like the formview to be displayed
if a specific datakey for an item in the gridview is passed through the
querystring.

I have the following code in place on the page_load event to handle this:
If Not
String.IsNullOrEmpty(Request.QueryString("funding_ request_id")) Then
sqlPACE.SelectCommand =
sqlPACE.SelectCommand.Insert(sqlPACE.SelectCommand .IndexOf("ORDER BY"), "
WHERE funding_request_id=" & Request.QueryString("funding_request_id") & " ")

gvFRequests.SelectedIndex = 0
'Threading.Thread.Sleep(10000)
Dim orig As New WebControls.CommandEventArgs("Select",
gvFRequests.SelectedIndex)
Dim args As New
WebControls.GridViewCommandEventArgs(gvFRequests, orig)
gvFRequests_RowCommand(gvFRequests, args)

End If

When I run this, the gridview correctly shows just the one row selected, but
doesn't display the formview. HOWEVER, if I place a breakpoint in the
page_load event, the formview appears after I continue the execution! Remove
the breakpoint and the formview will not be displayed. As you can see, I
tried "sleeping" the thread to see if that would do it, but it doesn't work.
Any ideas?