[Implementing the ASP. Net Control as day26] Makes your gridview different

Source: Internet
Author: User

You can find a considerable numberArticleIn my blog, I also have many articles about extended functions of the gridview, datacontrolfield, and boundfield. In this article, I will describe these articles on extended functions and field categories of the gridview control, if you want to extend the functions of the gridview, you can use them as a reference.

1. Extend the gridview control-display the title column when no data exists

Abstract: when the number of datasource data records tied to the gridview is 0, no data is displayed according to the settings of emptydatatemplate and emptydatatext. If we want the gridview to display the field title when there is no data, one way is to manually set a title column in The emptydatatemplate, but this is very troublesome. In this article, the gridview control is extended, and the field title can be displayed without data directly through attribute settings.

 

 

2. Extended gridview control-Support for Excel and Word Export

Abstract: It is quite common to export Excel and Word files in the gridview. This article will expand the gridview control to provide a way to export Excel and Word files. Generally, the following common problems in the export of the gridview will be solved here.

 

 

3. Add/modify/Delete the displayed data in the gridview + formview (advanced tutorial: Server Control)

Abstract: Expand the gridview and formview controls, add the formviewid attribute to the gridview control, and associate it with the specified formview Control ID. Then, the gridview can be used in combination with formview to perform data change operations.

4. Extended commandfield category-delete prompt message

Abstract: The deleteconfirmmessage attribute is added to set the deletion Prompt confirmation message.

 

 

5. Extended commandfield category-the deletion prompt message contains Field Values

Abstract: The deletion confirmation message can contain the specified datafield field value, and the data column to be deleted is explicitly prompted.

 

 

6. Tie checkboxfield to a non-Boolean (0 or 1) Field

Abstract: If checkboxfield is 0 or 1 (non-Boolean value), an error occurs. In this article, the checkboxfield category is extended, so that checkboxfield can be used to identify and fasten the Field Values of 0 or 1.

7. Extended checkboxfield category-supports bidirectional binding of non-boolean values

Abstract: checkboxfield fields cannot be directly converted to boolean values using cbool, such as "t/F" and "yes/no, if you want to use checkboxfield to display the data, it is quite troublesome. Generally, you can convert it to templatefield, write your own data binding function, and only support one-way binding. In this article, we will directly rewrite the checkboxfield category so that checkboxfield can be directly tied to materials such as "t/F" or "yes/no.

 

 

8. Extended commandfield category-added the Add button to the header

Abstract: You can add the "add" button to the commandfield header. Executing the "add" button triggers a rowcommand event.

 

 

9. The automatically numbered field of the gridview-tbserialnumberfield

Abstract: Inherit from datacontrolfield to write an automatic number field. If the gridview requires an automatic number field, you only need to add the field.

 

 

10. Customize the gridvie field category-implement the tbdropdownfield field category

Abstract: Field categories in the drop-down list can be displayed in the gridview.

 

 

11. Customize the gridview field-Date Field

Abstract: Field categories that can be edited from the date drop-down menu can be displayed in the gridview.

 

 

Note: This article is also published in "the first it state help tie Ren Competition". If you think this article is helpful to you, remember to repeat it to improve your popularity ^
Http://ithelp.ithome.com.tw/question/10013209

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.