If you want to display the DropDownList control in the FooterTemplate of the Gridview control, it will be applied when users add data. There are two methods to achieve this. One is to write a program in the OnRowDataBound event of the GridView control, and the other is to implement it in the OnDataBinding event of the GridView control.
First, write the GridView control and customize the FooterTemplate:
Write in cs and bind the data to the GridView control:
In this case, the web page looks like this:
OK. Now we will implement the following in the OnRowDataBound event:
Write this event to cs:
One instance class:
InsusListControlUtility objInsusListControlUtility = InsusListControlUtility ();
This class, you can refer to this link: http://www.cnblogs.com/insus/archive/2013/01/28/2880618.html
Run the web page to view the following information:
Now, we try to implement the OnDataBinding event in the GridView control. Let's take a look at Html markup:
OnDataBounding event in cs:
Both methods have the same browsing effect.