Nested GridView in ASP.NET

The GridView control is the successor to the DataGrid and extends it in a number of ways. In some situations we have to display data in a Master-Child manner. In the following article, you can see how to create a GridView control to display data in a Matser-Child way.

nested gridview


In this article I have used Microsoft's Pubs database for sample data. You can download it free from the following link.


How to nested Gridview Control

A GridView control inside the grid row of the parent GridView control is called a nested GridView. Here the program displays Master data from Publisher table and displays Child data from Titles table.


Here the Gridview show Master/Details in Expand/Collapse way. When you click on + symbol the Gridview expand the row and inside the row it display the child Gridview. Then the row display a - symbol and when you click on the - symbol the it collapse and show the master GridView only.

expand collapse gridview

Here the program manage this expand/collapse using two images and it functioning with the support of a small jQuery function.


C# Source Code

VB.Net Source Code (C) 2021    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.
SiteMap  | Terms  | About