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.
Unfortunately, activation email could not send to your email. Please try again.

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

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

 

Article ID: Published Date: Last Revised Date: Platform: Control:
7127 10/25/2016 10/25/2016 ASP.NET MVC Grid
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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.