gridview Nested-GridView

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

A Nested-GridView is a GridView control inside the grid row of the parent GridView control.

Syntax

  • <asp:GridView ID="gvParent" runat="server"></asp:GridView>
  • <asp:GridView ID="gvChild" runat="server"></asp:GridView>

Parameters

gvParentIt is a parent gridview control which contains a child gridview like gvChild control and other controls in gridview row like Labels, Buttons etc.
gvChildIt is a child gridview control that can also contain some other controls like in parent gridview. It will be nested in gvParent gridview control.

Remarks

Parent gridview can be bind using a simple DataBind function like gvParent.DataBind();. And for binding Child gridview, you have to bind it in OnRowDataBound event of parent gridview.



Got any gridview Question?