如何在vb.net中的转发器控件内使用datagrid [英] How to use datagrid inside repeater control in vb.net

查看:78
本文介绍了如何在vb.net中的转发器控件内使用datagrid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个转发器控件。

我将返回最多50行的各种数据,在此我想在转发器控制中使用datagrid控件来基于转发器控制值。我怎样才能做到这一点。可以为此发布解决方案会更有帮助。



ASPX代码;

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">
<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

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



中继器将显示更多然后20行。这里我想基于txtCasenumber为转发器控件的每一行加载数据网格。



提前谢谢


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

推荐答案

您必须绑定到Repeater的ItemDataBound事件,然后使用FindControl查找您的数据网格,然后像往常一样绑定它。



不是一个确切的答案,但概念应该完全相同,而不是嵌套的中继器,你使用嵌套的DataGrid。

嵌套和分组中继器 [ ^ ]
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[^]


这篇关于如何在vb.net中的转发器控件内使用datagrid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆