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

There's an excellent article on it on the Microsoft site: http://technet.microsoft.com/en-us/library/cc781907%28WS.10%29.aspx

What I usually do is to at least redirect "My Documents" to the same location as the users' home drive (or a subfolder in it, depends on the clients' needs). That way users do not get confused about what's in their home drive and what's in My documents and anything they save using Office's default save-as location will be on the netweork (where it's backed up...).

For notebook users you can use offline files - but be aware that in most Windows versions that's apain in the butt to support. So I usually restrict it to those users really needing it - and balance the need of re-directed folders against supportability; some users of who you know will struggle with offline files' questions might be better off with a local version of My Documents...
Random Solutions  
 
programming4us programming4us