Click here to Skip to main content
12,956,197 members (89,515 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I have a repeater control.
I will return maximum 50 rows with various data, In this i want to use datagrid control inside repeater control that to based on repeater control value. How can i do this. Can post solution for this will be more helpful.

ASPX Code;
<asp:Repeater ID="RepDetails" runat="server" onitemdatabound="RepDetails_ItemDataBound">
<table class="worksheet-frm" id="tblMain" width="100%"  runat="server">
<td style="FONT-SIZE: 10pt">Case#</td>
<td style="BORDER-BOTTOM-WIDTH: 0px">
<asp:textbox id="txtCasenumber" runat="server" CssClass="input" Width="150px" Text='<%# DataBinder.Eval(Container.DataItem,"CaseNumber")%>'>
<td style="FONT-SIZE: 10pt">Date Appointment Set</td>
<asp:textbox id="txtDateAppointmentSet" runat="server" CssClass="input" Width="150px" Text='<%# DataBinder.Eval(Container.DataItem,"DateAppointmentSet")%>'>
<td style="BORDER-TOP: #000066 3px solid" colspan="3">
<asp:DataGrid ID="grdJouranl" Runat="server"  AutoGenerateColumns="True" ShowHeader="True" AllowPaging="True"></td>
<td style="BORDER-TOP: #000066 3px solid" colspan="3">
<asp:DataGrid ID="grdOtherLeads" Runat="server" AutoGenerateColumns="True" ShowHeader="True" AllowPaging="True"></td>

Code Behind
dt = oDM.GetDataSet("dbo.Select").Tables(0)
RepDetails.DataSource = dt

Repeater will show more then 20 rows. Here i want to load the datagrid based on txtCasenumber for every row of repeater control.

Thanks in advance
Posted 14-Dec-12 0:51am
01010RAJ 14-Dec-12 7:08am
ya,paste ur code,I m not getting u.
rajrprk 14-Dec-12 7:39am
Pasted code can you look at it please

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You are going to have to tie into the ItemDataBound event of the Repeater then use FindControl to find your datagrid and then just bind it like you normally would.

Not an exact answer but the concept should be exactly the same, just instead of nested repeaters you're using a nested DataGrid.
Nested and Grouped Repeaters[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,869
CHill60 3,550
Maciej Los 3,243
ppolymorphe 2,070
Jochen Arndt 1,973

Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 14 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100