Hi,
Globally declare your child GridView as follows
GridView childGrid;
In ParentGridviews DataBound event find out the childGrid control
as follows :
protected void ParentGrid_RowDataBound(object sender, GridViewRowEventArgs e) {
if (e.Row.RowType == DataControlRowType.DataRow) {
childGrid = (GridView)e.Row.FindControl("childGrid");
}
}
protected void childGrid_RowDataBound(object sender, GridViewRowEventArgs e) {
if (e.Row.RowType == DataControlRowType.DataRow)
{
string rowid = childGrid.DataKeys[e.Row.RowIndex].Values[0].ToString();
// use this rowid for your further process of code.
}
}
hope this may help u.
Thank You
Manoj Chavan
-------------------------------------------
Web Application Developer(C#.NET, ASP.NET, C++.NET)
My BlogMy SiteMauli softwaresAlways think high, Always Dream High.
If this post helps you then plz Mark It as Answer