P
Phil Johnson
Hi,
I have 2 gridviews on an asp.net 2.0 form.
When I click select on a row in the first grid, in the
GridView1_SelectedIndexChanged event I set the value of a textbox (with
visibility set to false) to a string representation of a guid before calling
databind on my second grid.
The second grid never shows any data though, in fact it does not even show
the headers on the page unless I change its datasource to return all records,
not just filtered for the one selected in the first grid.
I initally just used a select statement in the datasource with an object
form parameter which got the value from my hidden text box, but I changed
that now to use a stored procedure that takes a string parameter and converts
that to a GUID inside the stored procedure.
If I configure the datasource when I test the query (which is the stored
procedure) I enter the valid guid in the parameter prompt and it does return
the values I should get in the test results pane.
My Datasource is set up as below and the value in txtLocationID at the point
where I call DataBind (on both the datasource and the gridview) is correct:
<asp:SqlDataSource ID="FIDS_AdPages" runat="server"
ConnectionString="<%$ ConnectionStrings:FIDSConnectionString %>"
SelectCommand="AdvertPage_ReturnForLocation"
SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:FormParameter FormField="txtLocationID"
Name="LocationID" Type="String" />
</SelectParameters>
--
Regards,
Phillip Johnson (MCSD For .NET)
PJ Software Development
www.pjsoftwaredevelopment.com
I have 2 gridviews on an asp.net 2.0 form.
When I click select on a row in the first grid, in the
GridView1_SelectedIndexChanged event I set the value of a textbox (with
visibility set to false) to a string representation of a guid before calling
databind on my second grid.
The second grid never shows any data though, in fact it does not even show
the headers on the page unless I change its datasource to return all records,
not just filtered for the one selected in the first grid.
I initally just used a select statement in the datasource with an object
form parameter which got the value from my hidden text box, but I changed
that now to use a stored procedure that takes a string parameter and converts
that to a GUID inside the stored procedure.
If I configure the datasource when I test the query (which is the stored
procedure) I enter the valid guid in the parameter prompt and it does return
the values I should get in the test results pane.
My Datasource is set up as below and the value in txtLocationID at the point
where I call DataBind (on both the datasource and the gridview) is correct:
<asp:SqlDataSource ID="FIDS_AdPages" runat="server"
ConnectionString="<%$ ConnectionStrings:FIDSConnectionString %>"
SelectCommand="AdvertPage_ReturnForLocation"
SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:FormParameter FormField="txtLocationID"
Name="LocationID" Type="String" />
</SelectParameters>
--
Regards,
Phillip Johnson (MCSD For .NET)
PJ Software Development
www.pjsoftwaredevelopment.com