How to bind excel worksheet data to a datagrid in WPF?
I'm trying to build a WPF app where the data source of a datagrid are some filtered data of a excel worksheet from a specific workbook. The worksheet looks something like this :
I'm loading the filtered data from that sheet to a datagrid using the below code on window load event :
Code:
DataTable dt = new DataTable();
dt.Columns.Add("Party");
Struggling to add filtered data from a excel file to datagridview using C# interop?
Say I've got a big excel file with multiple row & column (sample attached):
Code:
Row ID Order ID Order Date State
1 CA-2016-152156 8 November 2016 Kentucky
2 CA-2016-152156 8 November 2016 Kentucky
3 CA-2016-138688 12 June 2016 California
4 US-2015-108966 11 October 2015 Florida
5 US-2015-108966 11 October 2015 Florida
6 CA-2014-115812 9 June 2014 California
Leave a comment: