Net-informations.com
SiteMap  | About    

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

Database

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

Download

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.

Expand/Collapse

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.

Default.aspx

C# Source Code

VB.Net Source Code







net-informations.com (C) 2018    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.