BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
var picker = new FileOpenPicker();
picker.ViewMode = PickerViewMode.List;
picker.SuggestedStartLocation =
PickerLocationId.DocumentsLibrary;
picker.FileTypeFilter.Add(".csv");
var tempFile = await picker.PickSingleFileAsync();
if (tempFile != null)
{
var exStream = await tempFile.OpenStreamForReadAsync();
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
IWorkbook workbook = await application.Workbooks.OpenAsync(exStream, ",");
var data = workbook.Worksheets[0].Rows;
this.CsvGrid.ItemsSource = data;
exStream.Dispose();
}
Hi Alessandro,
We have analyzed your query and we regret to inform you that, you cannot directly get the items from WorkBook and assign it to Grid’s ItemSource. We need to manually get the items from Worksheet and assign it to a collection then assign the Grid’s ItemSource.
UG Links:
http://help.syncfusion.com/wpf/sfdatagrid/export-to-excel
http://help.syncfusion.com/file-formats/xlsio/working-with-excel-worksheet#save-worksheet-as-csv
Regards,
Jai Ganesh S