We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to import data from Excel file and bind it to Grid?

Platform: ASP.NET MVC |
Control: Grid |
Published Date: October 25, 2016 |
Last Revised Date: October 25, 2016

In Certain cases, users may like to read data from excel worksheet and bind it as dataSource for the Grid control. We can achieve this requirement using the Syncfusion.XlsIO namespace.

Solution:

Render the Grid control, by binding DataTable as dataSource using ViewBag.data

 

In the Controller, we can load and open an existing excel workbook using the Open method of IWorkbook class. We can export the sheet data to data table using the ExportDataTable method of the IWorkSheet and store the returned DataTable object to the ViewBag.data

 

2X faster development

The ultimate ASP.NET MVC UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon