As previous discussions you have to bind data with Gridview.
In this articles I am using 2 tables, Bank Table and Cheque Table
Bank Table
---------------
b_code int
b_name nchar(50)
Cheque Table
-----------------
ch_no nchar(10)
ch_bank int
For data binding to Gridview use below SQL query
SELECT Cheques.ch_no, Banks.b_name FROM Banks INNER JOIN Cheques ON Banks.b_code = Cheques.ch_bank ORDER BY Banks.b_name
After data bind as above, Gridview Shows 2 columns Cheque No. and Bank name.
As next step I am going to add Template filed
and drag and drop Dropdown list control to Gridview Item Template, as the normal way you have to bind data to dropdown list.
I used bank Table for bind data to dropdown list as below SQL query
SELECT [b_code], [b_name] FROM [Banks] ORDER BY [b_name]
For Select a data field to display in the DropDownList used Bank name (b_name) field from Bank Table and Select a data field for the value of the DropDownList used Bank code (b_code) field from Bank Table.
End the template field editing and view the browser.
You can see the dropdown list for each and every row. When you click on dropdown list you can see the bank names list and you can select the bank name.
Note :
-------
In this Gridview have 3 columns Cheque No., Bank name as label and Bank name as Dropdown List.
But Dropdown list showing "-" for every row. When binding data to Gridview how to select the bank name from Dropdown list.
There are 2 ways to do this, without using coding and using coding (VB & C#)
I ma going to explain in next articles.