You can try TemplateField like this for GridView1 (main GridView)
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton runat="server" ID="LinkButton1" CommandName="cmdName" CommandArgument='<%# Eval("IdColumn") %>' > LinkButton</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
and in GridView1 RowCommand you can get a CommandArgument and set up a DataSource for GridView2 (a child GridView).
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if(e.CommandName = "cmdName")
{
var arg = e.CommandArgument;
GridView2.DataSource = FilteredDataSource;
GridView2.DataBind();
}
}
source
share