Display the DropDownList control in FooterTemplate

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.