Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Exporting datagrid from to an Excel, Word and notepad format
WhatsApp
Dhaval Khunt
14y
16.9k
0
0
100
Article
ExportDataGrid_2.zip
Many times we would like to export our page as an Excel sheet, Word doc or PDF file. This can be simply achieved by changing the ContentType of the Response object and overriding the RenderControl method of the control to be exported
Export to Excel,word and notepad are one of the most common functionality required in ASP.Net pages.Users can download the data from the datagrid into an Excel spreadsheet for offline verification and/or computation. This article includes the source code for such functionality.
How it works
This main functionality to Export a datagrid from an ASP.Net Web Form to an Excel,word and notepad format is actually very simple. There are several solutions for this implementation and in this example we will convert the datagrid to excel,word and notepad format. The RenderControl method available in the .Net Framework provides the server control content to an HtmlTextWriter which is subsequently written out to the Response Stream.
datagrid to excel
datagrid to word
datagrid to notepad
Up Next
Ebook Download
View all
Diving Into ASP.NET WebAPI
Read by 21.4k people
Download Now!
Learn
View all
Membership not found