Click here to Skip to main content
15,896,338 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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" />
Posted

1 solution

hi,

try this

VB
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
 
Share this answer
 

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