Dynamic Data Binding (Repeater controls HeaderTemplate and ItemTemplate)

Source: Internet
Author: User

A few days ago, Insus. NET has written the "dynamic binding data (GridView control Header and ItemTemplate)" http://www.cnblogs.com/insus/p/3303192.html article, but that is to implement the GridView control. According to previous rules, some netizens called Insus. NET implemented dynamic data binding using the Repeater control. Okay. Currently, Insus. NET uses the Repeater control to dynamically bind HeaderTemplater and ItemTemplate.

Use the data source from the previous article. Because they have the same fields.
Write the following in html markup:



The following describes how to bind data to the Repeater control:



When you dynamically bind HeaderTemplate and ItemTemplate, first obtain all column names from the Data source:



OK. Now we can write the OnItemDataBound = "RepeaterFruit_ItemDataBound" event:



To make it a success, preview it:


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.