Question : Access control inside nested gridview

Hello experts,

I have a gridview nested within a gridview.


   


Within Gridview 2 I have a linkbutton which has an event and on that event I would like to get access to it's parents gridview key value.

So for instance this usually works if the gridview is not nested like attached (below).

So I think what is needed is to get the row's parent (which is gridview2) and go from there. So my question is how can I get access to gridview2 using the code below?

Thanks

Code Snippet:
1:
2:
3:
4:
5:
6:
7:
protected void LinkButton1_Click(object sender, EventArgs e)
    {
        LinkButton lb1 = (LinkButton)sender;
        GridViewRow row = (GridViewRow)lb1.NamingContainer;
        
        long intOrderItemId = Convert.ToInt64(GridView2.DataKeys[row.RowIndex].Value);
    }

Answer : Access control inside nested gridview

matthew016,

The Cleanup team will get to it eventually.

Please remember that the Cleanup team, like the Experts, Mods, and Admins, are all volunteers.  We are lucky to get whatever time they devote to Cleanup activities.

If you want to help make a difference, then as my colleague ModernMatt suggested, I encourage you to contact AnnieMod and tell her that you are interested in doing Cleanup.  Otherwise, I ask you to be patient.
 
modus_operandi
EE Admin
Random Solutions  
 
programming4us programming4us