GridView's selection isn't causing other GridView's to load data asexpected

R

Rasika WIJAYARATNE

Hi everyone,

I have two grid-views and I am trying to populate the data on gv2
based on the selection in gv1. However when a row is selected in gv1,
it doesn't populate the gv2 with data. I have ensured that the
ObjectDataSource (ods2) for gv2 works and load data correctly by
specifying hardcoded primary key value within a Paramater.

Anyone know what is a miss here to prevent gv2 from loading it's
data???


[Grid where rows are selected from.]
<asp:GridView ID="gv1" runat="server" AllowPaging="True"
AllowSorting="True"
AutoGenerateColumns="False" DataSourceID="ods1"
DataKeyNames="myID">
<Columns>
<asp:CommandField ShowSelectButton="True" />
...
</Columns>
</asp:GridView>


[Grid where sub-details rows are displayed based on above
selection.]
<asp:GridView ID="gv2" runat="server" AutoGenerateColumns="False"
DataSourceID="ods2">
<Columns>
...
</Columns>
</asp:GridView>


[Data source for getting the sub-details for gv2, based on
selection in gv1.]
<asp:ObjectDataSource ID="ods2" runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetData"
TypeName="MyTableAdapters.MyTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="gv1" Name="myID"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top