Reputation: 1706
I am stuck here.
I have a GridView
with another GridView
(As A Template Column as a User Control) nested in it.
Both are bound to an ObjectDataSource
. My Problem now is how I pass the ID from the Parent Row to the Child Grid in order to only show the relevant data.
Example:
<ParentGridView>
<Columns>
<ID/>
<ChildGridView/>
</Columns>
</ParentGridView>
How can i pass the ID from ParentGridView to ChildGridView ?
Thank you.
Upvotes: 0
Views: 1932
Reputation: 14470
try something like this
var gvParent= (GridViewRow)gvChild.Parent.Parent;
or
var gvParent= (GridViewRow)gvChild.Parent.Parent.Parent;
Also have a look at this article about Creating a Nested GridView Control
Upvotes: 1