To nest the DropDownList control to GridView control is very helpful to show the data by selectable criteria. The DropDownList control can be easily nested to the GridView control. In this sample, each DropDownList is binded for different data. For instance, we can use GridView to show each category data in Northwind database, while we can use DropDownList to show all products under the selected category in each line. We will show you this tutorial by ASP.NET 2.0 and VB.NET.

To nest the DropDownList control to GridView control is very helpful to show the data by selectable criteria. The DropDownList control can be easily nested to the GridView control. In this sample, each DropDownList is binded for different content. For instance, we can use GridView to show each category data in northwind database, and we can use DropDownList to show all products under the selected category in each line.

First, to connect to the sample database, you will need to import the System.Data.SqlClient namespace.

Then please create a getdataset. And add a string query for data query in the sample database.

The front GridviewNestingDropdowlist.aspx page looks something like this:

The flow for the code behind page is as follows.

Download Source Files