Click here to Skip to main content
15,893,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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;
XML
<asp:Repeater ID="RepDetails" runat="server" onitemdatabound="RepDetails_ItemDataBound">
<itemtemplate>
<table class="worksheet-frm" id="tblMain" width="100%"  runat="server">
<table><tbody><tr>
<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>
<td style="FONT-SIZE: 10pt">Date Appointment Set</td>
<td>
<asp:textbox id="txtDateAppointmentSet" runat="server" CssClass="input" Width="150px" Text='<%# DataBinder.Eval(Container.DataItem,"DateAppointmentSet")%>'>
</td>
<table><tbody><tr>
<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>
</tr></tbody></table>

</tr></tbody></table></itemtemplate>

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

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
v4
Comments
StackQ 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

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[^]
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900