Use a condition to strip the value of the GridView that meets the condition.

Source: Internet
Author: User

For example, in the title of a blog post, you can strip the qualified values in the GridView Control Based on certain conditions.
To meet these requirements, only people can capture the data that meets the requirements. The GridView control displays data in the TemplateField template. Insus. NET does not use any controls, such as label or literal, to render data. Writing the OnRowDataBound event later will teach you how to capture the required data.



The following is the row data binding for the GridView control, because in Insus. the. NET blog has written countless times about how to create data, write stored procedures, and create objects (class classes). These are not important in this article, so they are skipped.



The following is the OnRowDataBound = "GridViewFruit_RowDataBound" event:



The title column name uses an alias different from the database field. You must find the column index to be processed. The preceding condition indicates that the FruitName is "sea Bread Fruit" or "Kiwi", and the strikethrough is required.
When running a webpage:



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.