Values of hidden columns in the gridview

Source: Internet
Author: User

Once again, the hidden columns in the gridview of 05 cannot be bound, that is, if a column is set to visible = false, no data binding will be performed, that is to say, the text in this column cannot be obtained directly from the gridview.
I checked the information and found out the support for standard Web 2.0 in the past or 05.
This feature is almost essential in the DataGrid era and is useful for batch selection of lists (such as batch deletion ), hidden columns are usually used to store the values of the key words corresponding to the data record of the row in the DataGrid, but they do not work in the gridview, which is a headache for a large number of people. They also have their solutions online, one of them is as follows. The principle is to set its CSS style to invisible when creating a row, so as to avoid the data not binding problem caused by directly setting column visible = false:

Void Gridviewinclurowcreated (Object sender, gridviewroweventargs E)
{
  // Make the index 0 The column is not visible, but is actually generated CSS Code
E. Row. cells [0]. Visible = false;
  // Other code if neccecary
}

Another option is to set the style of the bound columns.
(1) set a CSS class:

. Hidden {display: none;} (2) then, in the column editing dialog box of the gridview, set the columns to be hidden and set footstyle, headerstyle, respectively, the cssclass attribute of itemstyle is "hidden"

In this way, the effect is the same as that of the Hidden Column passing value in the DataGrid in 03.

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.