The data records in the DataGrid are exported to excel.

Source: Internet
Author: User

Online data sorting by root users:
You do not need to solve the problem of substitution. If a datagridy column is similar to a counter column, you can set the cursor column before the cursor column is output, which indicates that the cursor column is invisible. after the end () operation, restore the original metadata of the columns that cannot be parsed.
For example, DataGrid. Columns [I]. Visible = false;

1 response. contenttype = "application/vnd. MS-excel ";
2 response. charset = "gb2312 ";
3 system. Io. stringwriter Sw = new system. Io. stringwriter ();
4 system. Web. UI. htmltextwriter write = new htmltextwriter (SW );
5 targetgrid. rendercontrol (write );
6 response. Write (SW. tostring ());
7 response. End ();

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: 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.