+ 3
Copy and Paste from Excel to WPF DataGrid
I'm trying to implement a copy and paste functionality in WPF app. i.e from MS Excel to DataGrid. I saw some sample codes online like these ones below but non of them met my requirement https://www.codeproject.com/Articles/246306/Implementing-Copy-Paste-for-WPF-DataGrid-net-4 https://stackoverflow.com/questions/4118617/wpf-datagrid-pasting What I want is; when pasting, the data on the DataGrid should appear as what it was in the MS Excel. (Assuming you're copying from one excel sheet to another). Thanks!
2 ответов
0
Thanks Adam for your answer
- 1
You should use open office xml package to read the Excel file. Then just read the headers to create the datagridview columns and fill in the data.