Hi
I created nested gridview refereing asp.snippets.. Its working fine now requirement is to add Checkbox within child grid.. i added childgrid by
</asp:TemplateField>
<asp:TemplateField HeaderText="Approve">
<ItemTemplate>
<asp:CheckBox ID="chkmark" runat="server" OnCheckedChanged="chkmark_CheckedChanged" CommandName="cmdmark" AutoPostBack="true" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" />
</ItemTemplate>
</asp:TemplateField>
I used parent Grid Row Data Bound Event to Bind Child Grid Like
GridView gvOrders = e.Row.FindControl("GVDpidispchild") as GridView;
gvOrders.DataSource = dts.DefaultView;
gvOrders.DataBind();
GridView gvChild = (GridView)e.Row.FindControl("GVDpidispchild");
gvchild.datasource=datasource();
gvchild.dataBind();
When I checked on Child Grid Checkbox Checked event i am unable to find Childgrid (gvchild)
protected void chkmark_CheckedChanged(object sender, EventArgs e)
{
GridViewRow row = ((GridViewRow)((CheckBox)sender).NamingContainer);
int index = row.RowIndex;
// here I need to Find control of gvchild
}
and also I tried with Row Command
protected void GVDpidispparents_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
GridView gvOrders = e.Row.FindControl("GVDpidispchild") as GridView;
gvOrders.RowCommand += new GridViewCommandEventHandler(gvOrders_RowCommand);
}
}
void gvOrders_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName.ToString() == "cmdmark")
{
}
}
How to find child grid check box control
Thanks In adavance
Narasappa