如何在asp.net中获取子gridview链接按钮值 [英] How to get child gridview link button value in asp.net
问题描述
我在另一个gridview中有一个gridview。如何获取子gridview的单元格值链接按钮。
< asp:gridview id =MasterGridrunat =Server>
< asp:模板字段>
< asp:label id =lbl1runat =server>
br mode =hold/ >
< asp:模板字段>
< asp:gridview id =ChildGridrunat =Server>
< asp:LinkButton ID =lnkPurchaserunat =serverCausesValidation =falseToolTip =查看/>
br mode =hold />
试试这个
Dim grdM As GridView = DirectCast (repeaterView1.FindControl( MasterGrid),GridView)
对于 每个 rowM 作为 GridViewRow 在 grdM。行
Dim grdC As GridView = DirectCast (rowM .Cells( 0 ) .FindControl( ChildGrid),GridView)
对于 每个 rowC 作为 GridViewRow In grdC。行
Dim lnkPurchase As LinkButton = DirectCast (rowC.FindControl( lnkPurchase) ,LinkButton)
下一步
下一步
I have a gridview inside another gridview. How to get cell value link button of the child gridview.
<asp:gridview id="MasterGrid" runat="Server">
<asp:Template Field>
<asp:label id="lbl1" runat="server">
br mode="hold" />
<asp:Template Field>
<asp:gridview id="ChildGrid" runat="Server">
<asp:LinkButton ID="lnkPurchase" runat="server" CausesValidation="false" ToolTip="View"/>
br mode="hold" />
hi,
try this
Dim grdM As GridView = DirectCast(repeaterView1.FindControl("MasterGrid"), GridView) For Each rowM As GridViewRow In grdM .Rows Dim grdC As GridView = DirectCast(rowM .Cells(0).FindControl("ChildGrid"), GridView) For Each rowC As GridViewRow In grdC .Rows Dim lnkPurchase As LinkButton = DirectCast(rowC.FindControl("lnkPurchase "), LinkButton) Next Next
这篇关于如何在asp.net中获取子gridview链接按钮值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!