Using the output of repeater as a datasource for a nested GridView

K

Kieran

Hello,
I am trying to use a GridView nested within a repeater to group items
together.

To do this I would like to use the output of the repeater control
(int_pk_parent_definition_id) to be the SQL parameter for the stored
procedure which is the datasource for the GridView.

Any ideas? Help would be much appreciated. I've included what I've
done so far below but it doesn't work because
"int_fk_definition_parent_id" isn't a property of Repeater2...

Thanks in advance,
Kieran



<asp:Repeater ID="Repeater2" runat="server"
DataSourceID="ParentDefinitions" >
<ItemTemplate>
<%# Eval("str_definition_name") %>
<br />
<asp:HiddenField
ID="hfldParentDefID" runat="server" Value="1"/>



<asp:GridView ID="GridView1"
runat="server" AllowPaging="False" AllowSorting="True"
AutoGenerateColumns="False" DataKeyNames="int_pk_defintion_id"
DataSourceID="ChildDefinitions">

<asp:BoundField DataField="dt_created"
HeaderStyle-HorizontalAlign=Left HeaderText="Datecreated"
SortExpression="dt_created" />

</asp:GridView>

</ItemTemplate>
</asp:Repeater>

<asp:SqlDataSource
ID="ParentDefinitions" runat="server" ConnectionString="<%$
ConnectionStrings:CRN_CRMConnectionString %>"

SelectCommand="p_defParentDefinitionListAll"
SelectCommandType="StoredProcedure"></asp:SqlDataSource>

<asp:SqlDataSource ID="ChildDefinitions"
runat="server" ConnectionString="<%$
ConnectionStrings:CRN_CRMConnectionString %>"

SelectCommand="p_p_defChildDefinitionListForParent"
SelectCommandType="StoredProcedure">
<asp:ControlParameter
ControlID="Repeater2" Name="int_fk_definition_parent_id"

PropertyName="int_pk_definition_parent_id" Type="Int32" />
</asp:SqlDataSource>
 

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,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top